Skip to content

Instantly share code, notes, and snippets.

View cpliakas's full-sized avatar

Chris Pliakas cpliakas

  • Greater Boston Area
View GitHub Profile
@cpliakas
cpliakas / clear-cache-drupal
Created August 2, 2012 16:05
Find and clear all cache tables
mysql -B -N dbname -e "SHOW TABLES LIKE 'cache%'" | xargs -I {} mysql dbname -e "TRUNCATE {}"
@cpliakas
cpliakas / ubuntu-x11
Created May 4, 2012 16:07
Headless X server on Ubuntu for X11 forwarding
#!/bin/bash
sudo apt-get install xserver-xorg xserver-xorg-core x11-apps x11-xserver-utils
@cpliakas
cpliakas / Mysqltop
Created February 9, 2012 03:27
Mysql top
#!/bin/bash
watch -n 5 --differences mysqladmin processlist
@cpliakas
cpliakas / Screenshot file
Created January 25, 2012 20:24
Taking screenshots from a list of files
#!/bin/bash
if [ -z "$1" ]; then
echo "Filename required."
exit 1
fi
while read LINE; do
URL=$(echo "$LINE" | awk '{print $1'})
FILENAME=$(echo "$LINE" | awk '{print $2'})
@cpliakas
cpliakas / screenshots
Created January 24, 2012 16:55
Browser screenshots from the command line on Ubuntu
#!/bin/bash
xvfb-run --server-args="-screen 0, 1024x768x24" wkhtmltopdf -q -B 0 -T 0 -L 0 -R 0 http://google.com google.com.pdf
convert -density 300 google.com.pdf -append google.com.jpg
@cpliakas
cpliakas / Ubuntu Virtual Network Device
Created January 19, 2012 19:15
Adds a virtual network interface to Ubuntu's network config file
#!/bin/bash
cat <<EOF >> /etc/network/interfaces
# Virtual network interface
auto eth1
iface eth1 inet static
name Host-only adapter
address 192.168.56.15
netmask 255.255.255.0
@cpliakas
cpliakas / Set Apache Solr to read only
Created January 12, 2012 16:06
Set's the Apache Solr Search Integration module's read only setting to TRUE
#!/bin/bash
drush vset --yes apachesolr_read_only 1
@cpliakas
cpliakas / Drupal email scrub command
Created January 11, 2012 19:00
Updating Drupal user email addresses for development environments
UPDATE users SET mail = CONCAT('test+', uid, '@example.com');
@cpliakas
cpliakas / vbox-guest-additions.sh
Created January 4, 2012 15:56
Helper script to install VirtualBox Guest Additions on Ubuntu servers.
#!/bin/bash
apt-get install dkms build-essential linux-headers-`uname -r` linux-headers-generic xserver-xorg xserver-xorg-core
mount /dev/cdrom /mnt
bash /mnt/VBoxLinuxAdditions.run
unount /mnt