Posts

Prevent ssh timeouts

Locally add the following to ~/.ssh/config ServerAliveInterval 120 # null packet every 120 seconds On the server side add the following: ClientAliveInterval 120 # null packet every 120 seconds ClientAliveCountMax 720 # 24hs Done!

fail2ban unban ip

To search all the ips that were banned we enter interactive mode: $ fail2ban-client -i Then we check a jail status, for example sshd : > status sshd the output: Status for the jail: sshd |- Filter |  |- Currently failed: 0 |  |- Total failed: 27 |  `- File list: /var/log/auth.log `- Actions    |- Currently banned: 37    |- Total banned: 38    `- Banned IP list: <a big list of banned ips> So, if we want to unban a particular ip address, let's say X Then, we execute: > set ssh unbanip (within interactive mode) Lastly, if you want to execute it directly from command line: $ fail2ban-client get <JAIL> actionunban <IP-ADDRESS> That's all.

Cleaning Bash History...

Just run: cat / dev / null > ~/. bash_history && history - c && exit

The document "mydoc" could not be saved. You don’t have permission

Just run the following command: $ chmod -R -N mydoc

*** System Restart Required *** - Ubuntu

Which packages need a system reboot? Just check /var/run/reboot-required.pkgs

Install memcached in Mac OS El Capitan

The easiest way to install memcached is to use homebrew package installer: $ brew install memcached This locates memcached in /usr/local/opt/memcached/bin/ Starting memcached (by default at port 11211 or with -p port_number): $ memcached -p 9000 To have launchd start memcached now and restart at login: $ brew services start memcached To change the default ram size (64mb) used by memcached use -m option: $ memcached -m 128  -p 9000 Lastly, run memcached as a daemon with -d: $ memcached -d -p 9000