Category Archives: Linux

This is where all my linux pages will live.

To prevent an apt package from auto updating

Using apt you can hold a package using sudo apt-mark hold package_name and remove the hold with sudo apt-mark unhold package_name

Posted in Linux | Comments Off on To prevent an apt package from auto updating

Preventing access to a website from specific IP addresses with Deny/Allow

Configure the Virtual Host as follows: Order Deny,Allow Deny from all Allow from 11.211.0.0/15 Allow from 12.212.0.0/15 Require valid-user Satisfy all AuthName “Restricted Area” AuthType Basic AuthUserFile /home/web/.htpasswd Require valid-user Create file with the following command: htpaddwd /home/web/.htpasswd Another option: … Continue reading

Posted in Linux | Comments Off on Preventing access to a website from specific IP addresses with Deny/Allow

Password Protecting a web site

Add the following to .htaccess: CentOS: AuthType Basic AuthName “Restricted” AuthUserFile /etc/httpd/htaccess-pass Require valid-user #Order deny,allow #Deny from All #Satisfy any Create the file as follows: htpasswd /etc/httpd/htaccess-pass username You will then be prompted for a password Ubuntu: AuthType Basic … Continue reading

Posted in Linux | Comments Off on Password Protecting a web site

Useful netstat commands

To show which IP addresses are currently connected to your server: netstat -nt

Posted in Linux | Comments Off on Useful netstat commands

Connecting to an external MySQL server through an SSH tunnel

Scenario: You’re at home, and you want to connect to a mysql server on the other side of a firewall. There is a machine with ssh open on it that you can use as a gateway. On your home machine: … Continue reading

Posted in Linux, SSH | Comments Off on Connecting to an external MySQL server through an SSH tunnel

Rsync Commands

rsync -avnh source target #Use rsync to sync to remote system as user over remote shell compressing transfer and without crossing filesystem boundaries rsync -avzx -e ssh /var/www/ user@remote_host:/var/www/ #Use rsync to sync to remote system as user over remote … Continue reading

Posted in Linux | Comments Off on Rsync Commands

Using grub

It is relatively easy to boot GNU/Linux from GRUB, because it somewhat resembles to boot a Multiboot-compliant OS. Set GRUB’s root device to the same drive as GNU/Linux’s. The command search –set=root –file /vmlinuz or similar may help you (see … Continue reading

Posted in Linux | Comments Off on Using grub

Stuff to review

http://www.codinghorror.com/blog/2007/10/a-visual-explanation-of-sql-joins.html rpm -V output: S file Size differs M Mode differs (includes permissions and file type) 5 MD5 sum differs D Device major/minor number mismatch L readLink(2) path mismatch U User ownership differs G Group ownership differs T mTime differs

Posted in Linux | Comments Off on Stuff to review

Best Practices for WordPress sites

Best practice from my experience when it comes to WordPress and permissions is: • Owner: SFTP/site user • Group: apache • Directory Permissions: 02775 (drwxrwsr-x) • File Permissions: 0664 (-rw-rw-r–) • Directory ACLs: default:user:siteUser:rwx, default:user:apache:rwx, user:siteUser:rwx, user:apache:rwx • File ACLs: … Continue reading

Posted in Linux | Comments Off on Best Practices for WordPress sites

Verifying port 443

openssl s_client -connect localhost:443 CONNECTED(00000003) 4504:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:588:

Posted in Linux, OPENSSL and TLS | Comments Off on Verifying port 443