This nifty little shell script will automatically install keys for any PPA you have added to your sources lists. Handy but use with caution. The keys are there to protect you. Automating their install, while handy, leaves you blind to a hack.
#! /bin/sh
if [ "`whoami`" != "root" ];
then
echo "Please run with SUDO"
exit 1
fi
RELEASE=`cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d"=" -f2`
echo Release: $RELEASE
echo Please Wait...
for q in `find /etc/apt/ -name *.list`; do
cat $q >> fullsourceslist
done
for i in `cat fullsourceslist | grep "deb http" | grep ppa.launchpad | grep \
$RELEASE | cut -d/ -f4`; do
wget -q --no-check-certificate `wget -q --no-check-certificate \
https://launchpad.net/~$i/+archive -O- | grep \
"http://keyserver.ubuntu.com:11371/pks/" | cut -d'"' -f2 ` -O- | grep \
"pub " | cut -d'"' -f2 >> keyss
done
for j in `cat keyss` ; do
wget -q --no-check-certificate "http://keyserver.ubuntu.com:11371$j" -O- |\
grep -B 999999 END |grep -A 999999 BEGIN > keyss2
sudo apt-key add keyss2
rm keyss2
done
rm keyss
rm fullsourceslist
launchpad-update.tar.gz
Found this here thanks to the author (blackgr).
I recently started using nginx as my main web server. While it's a little tricky at first to figure out (documentation is all Russian), there are a few wiki's that help a lot. One of the things I couldn't figure out was how it determines the "default" vhost. In Apache this is the first host found in the Vhost configs (or alphabetically in sites-enabled/*) however this didn't seem to be the case with Nginx.
To make matters worse the way Nginx determines where to send traffic is significantly different than say Apache so some very weird things were happening with a couple of my hosts. So after a bit of reading I found the missing link. Logically enough it's the word default, the where is the weird part:
When defining a vhost it looks something like this:
server {
listen 80;
server_name server1.example.com;
location / {
root /path/to/server1.example.com/web/;
expires 1d;
}
To make this the default put "default" on the listen directive:
server {
listen 80 default;
server_name server1.example.com;
location / {
root /path/to/server1.example.com/web/;
expires 1d;
}
No more guessing or leaving it to nginx to determine the host based on URI.
Went to clean up a cache directory I was using for development tonight and realized I had about 6000 images in it. Running:
resulted in:
-bash: /bin/rm: Argument list too long
So I did some digging and found this little gem:
Simple enough I should'a thought of it myself.