Blogs

Peanut's blog

apt-get install incron
nano /etc/incron.allow # Line: root
incrontab -e # Line: /var/www IN_CREATE /bin/chown -R www-data:www-data /var/www/

Adapted from flat-file config at Raymii.Org.

/etc/exim4/main/20_exim4_prionyx_system_filter
system_filter = /etc/exim4/system_filter.exim
system_filter_directory_transport = local_copy_outgoing

What is writing to disk:
iotop -o -b -d 10

Port forward:
ssh -fN -L 32760:127.0.0.1:3306 prionyx.waspa.org.za

du -cksh *

ssh-copy-id -i ~/.ssh/mykey user@host

sudo mount -o resvport,rw -t nfs 10.42.0.1:/export/users nfs-export/

sudo nano /etc/profile: export http_proxy="http://x.x.x.x:8080

/usr/sbin/apachectl configtest

cvs diff -r 1.5 -r 1.4 filename

https://linuxconfig.org/how-to-setup-a-vpn-with-openvpn-on-debian-9-stretch-linux
Add a client:
# cd /etc/openvpn/certs
# source ./vars
# ./build-key clientname ##(Accept rational defaults, change FF_VPN_Server, DO NOT enter challenge password or optional Company Name)
# cd/etc/openvpn/client
# mkdir clientname
# cp client.conf clientname/clientname.conf ##(Copy client.conf to client dir renamed appropriately)

apt-get install openvpn easy-rsa

remove/flush all rules & delete chains
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

-F : Deleting (flushing) all the rules.
-X : Delete chain.
-t table_name : Select table (called nat or mangle) and delete/flush rules.
-P : Set the default policy (such as DROP, REJECT, or ACCEPT).

certbot certonly --standalone --preferred-challenges http -d waspa.org.za
certbot --apache certonly
certbot renew --dry-run

Change certs to LetsEncrypt
chmod 755 /etc/letsencrypt/{archive,live}; chgrp Debian-exim /etc/letsencrypt/{archive,live}

Check user exim -bt mailmanatispa [dot] org [dot] za

/var/virtual/waspa.org.za/mailman/bin/list_lists -b | while read list; do /var/virtual/waspa.org.za/mailman/bin/find_member -l $list "telkomsa.net"; done

or

`telkomsa.net"

or, best yet

/var/virtual/waspa/mailman/bin/find_member @telkomsa.net

waspa.org.za/mailman/bin/list_admins -a | grep -i ant@ff == no results

Delete a mailman list:
/var/virtual/waspa.org.za/mailman $ bin/rmlist no-alert
Not removing archives.  Reinvoke with -a to remove them.

 

netstat -anutp | grep SYN_RECV | wc -l

vnstat -l -i eth0

htop

tcpdump -i eth0 -nn 'tcp port 80' and 'tcp[13] == 2' -c 100

iptables -A INPUT -p tcp -m state --state NEW -m recent --update --seconds 60 --hitcount 20 -j DROP
 

 /etc/ufw/before.rules
 
*nat
:PREROUTING ACCEPT Array
# forward 129.232.230.123 port 22 to 192.168.230.123:22

-A PREROUTING -i eno1:1 -d 129.232.230.123 -p tcp --dport 22 -j DNAT --to-destination 192.168.230.123:22
# setup routing
-A POSTROUTING -s 192.168.230.0/24 ! -d 192.168.230.0/24 -j MASQUERADE
COMMIT

NOTE: NET-TOOLS (e.g. ifconfig) DEPRECATED. USE IPROUTE2

ip addr add 129.232.230.123/29 dev eno1 label eno1:0

iptables -t nat -A PREROUTING --src 129.232.230.123/29 -j NETMAP --to 192.168.230.123/24

https://serverfault.com/questions/627238/kvm-libvirt-how-to-configure-st...

virsh  dumpxml  ispa-vm | grep 'mac address'
virsh  net-list
virsh  net-edit default

virsh net-destroy default
virsh net-start default

Debian/Ubuntu only UID numbering!

mount -o nolock 10.10.122.1:/nfs/share /mnt/

export UGIDLIMIT=1000
cd /nfs/share/ff/move
awk -v LIMIT=$UGIDLIMIT -F: '($3>=LIMIT) && ($3!=29999)' /etc/passwd > move/passwd.mig
awk -v LIMIT=$UGIDLIMIT -F: '($3>=LIMIT) && ($3!=29999)' /etc/group > move/group.mig
awk -v LIMIT=$UGIDLIMIT -F: '($3>=LIMIT) && ($3!=29999) {print $1}' /etc/passwd | tee - |egrep -f - /etc/shadow > move/shadow.mig
less move/passwd.mig ls -ltr move/
ls -ltr move/

https://wiki.dovecot.org/ACL (Note, the configs moved from dovecot.conf)

UBUNTU 16.04:
/etc/dovecot/conf.d/10-mail.conf

# Directory where to look up mail plugins.
mail_plugin_dir = /usr/lib/dovecot/modules

# Space separated list of plugins to load for all services. Plugins specific to
# IMAP, LDA, etc. are added to this list in their own .conf files.
#mail_plugins =
mail_plugins = acl
protocol imap {
  mail_plugins = $mail_plugins imap_acl
}

In a nutshell, as root:
$ apt-get install mb2md
$ su - 'username
$ mb2md -s f2fpanel-aug2014.mbox -R ## User must be chown of source file!

Test

A tiny handheld projector that turns any surface into a giant 80" interactive touchscreen.

https://www.indiegogo.com/projects/touchpico-turn-any-surface-into-a-tou...

Upgrading to Drupal 6.2 leaves something to be desired as far as the image module goes.

It's bad enough for the average enthusiast that uploading images is not a core feature... but here's the fix that I found posted at http://drupal.org/node/219808

insert into image select upload.nid as nid , files.fid as fid , filename as image_size from upload, files where upload.fid = files.fid and files.filemime like "image/%";

Embed a picture: <img src="http://url_name/img_name" border="0" align="right" padding-left="4px" />
Link to a URL: <a href="http://url_name" target="_blank">Link name</a>

<code><a href="http://www.wildcoast.com">Wild Coast</a></code>

http://www.wildcoast.com/html_tips . . . this entry is mainly just a test to see if filtered html is automatically linking URL entries. Which it wasn't. Hence the above torture.