----------------------------------------------------------------

SSH

---------------------------------------------------------------- Force close a ssh connection (~.) Sending an escape character "~" followed by a dot "." will close the connection. The escape character only works at the beginning of a line, so you my need to press "Enter" first. ---------------------------------------------------------------- SSH Tunnels -----------

# ssh tunnel to make accessible from internet ssh -N -f -R 0.0.0.0:55555:localhost:22 root@blog.pigpoppo.com # ^ ^internet port ^local port | Specify wildcard. default is localhost* *you may need to edit /etc/ssh/sshd.config to set: GatewayPorts=clientspecified # upgraded to autossh to keep connection alive autossh -N -f -R 55555:localhost:22 root@blog.pigpoppo.com

---------------------------------------------------------------- ----------------------------------------------------------------

Proxmox

---------------------------------------------------------------- Edit the Javascript file: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js Find the lines: Ext.Msg.show({ title: gettext('No valid subscription'), Void the function: void({ //Ext.Msg.show({ title: gettext('No valid subscription'), Restart the service: systemctl restart pveproxy.service ----------------------------------------------------------------

OpenSSL

# view cert openssl s_ check cert dates # view expiration cert dates openssl s_client -connect library.csmd.edu:443 | openssl x509 -noout -dates ----------------------------------------------------------------

OpenVPN

Making a OpenVPN entry point ---------------------------- # enable ip forwarding

echo '1' >> /proc/sys/net/ipv4/ip_forward

# add iptables rules to route traffic from main interfaces to the vpn (i dont fully understand this)

iptables -t nat -A POSTROUTING -o tun+ -j MASQUERADE iptables -A FORWARD -i ens+ -o tun+ -j ACCEPT iptables -A FORWARD -o tun+ -j ACCEPT iptables -A FORWARD -i tun+ -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -i tun+ -j ACCEPT

preparing clients ----------------- clients dont need much. mainly, they just need a default route pointing to the entry server.

sudo ip route del default sudo ip route add default via 10.0.0.173

you might be better off just using DHCP.

Firefox

about:config browser.newtabpage.activity-stream.showSponsoredTopSites false

Mounting

# mount NFS share sudo mount -t nfs <nfs_server:/path/to/share> /mnt # mount windows partition that is hibernated mount -t ntfs-3g -o remove_hiberfile /dev/<sdx0> /mnt

Vim Tricks

# sudo trick :w !sudo tee % # execute current line in bash :.w !bash

Stupid Linux stuff

titty terminal change tty[1-6] to titty[1-6]

sudo sed -r -i 's/(ti)?\\l/ti\\l/g' /etc/issue

---------------------------------------------------------------- mouse jiggler

# set X display export DISPLAY=":0" distance=10 # radius of the jiggle delay=0.1 # time in seconds to wait between jiggles while true do randomAngle=$((1 + RANDOM % 360)) inverseAngle=$(( ($randomAngle+180) % 360)) # move random direction xdotool mousemove_relative --polar $randomAngle $distance sleep $delay # return to initial position xdotool mousemove_relative --polar $inverseAngle $distance sleep $delay done

----------------------------------------------------------------

Pranks

Pranks and tricks to run on peoples linux computers when they forget to lock them.

# increasingly slower bash startup echo 'sleep 0.01' >> ~/.bashrc # or ~/.bash_profile