Skip to content

Instantly share code, notes, and snippets.

@ifnull
ifnull / gist:4955258
Last active December 13, 2015 18:28
AWS: Quick and secure LAMP on Amazon Linux
######
###### http://www.altmake.com/2013/03/06/secure-lamp-setup-on-amazon-linux-ami/
######
# http://imperialwicket.com/aws-quick-and-secure-lamp-on-amazon-linux
sudo su -
yum -y update
@ifnull
ifnull / gist:4955407
Created February 14, 2013 19:10
Add sublime shortcut
sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/bin/subl
@ifnull
ifnull / gist:4983774
Created February 19, 2013 07:26
Xbian Upgrade notes. Untested.
echo raspberry | sudo -S chmod +s /bin/su
sudo su
cd /home/xbian/
git clone git://github.com/xbianonpi/xbian.git source
for i in $(pgrep -u xbian); do kill -9 $i; done;
@ifnull
ifnull / gist:5042398
Created February 26, 2013 21:31
USA only Tor nodes.
ExcludeNodes {be},{pl},{ca},{za},{vn},{uz},{ua},{tw},{tr},{th}, {sk},{sg},{se},{sd},{sa},{ru},{ro},{pt},{ph},{pa}, {nz},{np},{no},{my},{mx},{md},{lv},{lu},{kr},{jp}, {it},{ir},{il},{ie},{id},{hr},{hk},{gr},{gi},{gb}, {fi},{es},{ee},{dk},{cz},{cy},{cr},{co},{cn},{cl}, {ci},{ch},{by},{br},{bg},{au},{at},{ar},{aq},{ao}, {ae},{nl},{de},{fr}
@ifnull
ifnull / gist:5055099
Created February 28, 2013 08:10
List permission as numeric values
stat -c "%a %n" .
@ifnull
ifnull / gist:5055107
Created February 28, 2013 08:13
Set permissions for Apache
chown -R apache:www-data .
find . -type d -exec chmod u=rwx,g=rx,o= '{}' \;
find . -type f -exec chmod u=rw,g=r,o= '{}' \;
@ifnull
ifnull / yum-security.cron
Created March 7, 2013 01:03
YUM cron for automatic security updates.
#!/bin/sh
yum -y -R 120 -d 0 -e 0 update yum
yum --security -y -R 10 -e 0 -d 0 update
@ifnull
ifnull / logwatch.cron
Last active December 14, 2015 14:59
Simple cron for logwatch
#!/bin/sh
/usr/sbin/logwatch --output mail --mailto root@localhost --detail high
@ifnull
ifnull / gist:5239597
Created March 25, 2013 18:54
Fix virtualenvs after upgrading to Mountain Lion.
# Comment out virtualenv and mkvirtualenv from .bash_profile
defaults write com.apple.versioner.python Version 2.7
cd ~/Downloads/
curl -o setuptools-0.6c11-py2.7.egg https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg#md5=fe1f997bc722265116870bc7919059ea
sudo sh setuptools-0.6c11-py2.7.egg
rm setuptools-0.6c11-py2.7.egg
sudo easy_install pip
sudo pip install virtualenv
sudo pip install virtualenvwrapper
sudo touch /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/__init__.py
@ifnull
ifnull / gist:5268183
Last active December 15, 2015 13:38
Restart Apple Remote Desktop (ARD) agent when it crashes.
sudo killall "Remote Desktop"
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -stop
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -privs -all -restart -agent