View test.pquery.pl
#!/usr/bin/perl
use strict;
use warnings;
# install pQuery:
# sudo cpanm pQuery;
use pQuery;
my $url = "https://github.com/sodonnell/plowbot/";
View install.awscli.sh
yum -y install python34 python34-pip
pip3 install --upgrade pip
pip3 install awscli
View Add basic php-fpm proxy to apache config
echo -e "<FilesMatch \\.php$>\n\tSetHandler \"proxy:fcgi://127.0.0.1:9000\"\n</FilesMatch>\n\n" >> /etc/httpd/conf/httpd.conf;
View mount_iso.sh
#!/bin/bash
sudo mkdir /mnt/iso
sudo mount -o loop disk.image.iso /mnt/iso
View nmap-lan-httpd
# This assumes you're using the 192.168.0. class-C subnet.
# Modify according to your specific subnet.
# default http/https ports
nmap 192.168.0.0/24 -P0 -p 80,443 | grep -B 4 "open"
# commonly used http, proxy and other related ports
nmap 192.168.0.0/24 -P0 -p 80,443,8000,8080,9000,9090 | grep -B 4 "open"
View Replacing strings in a single file using Perl
sudo perl -pi -e 's/Defaults requiretty//' /etc/sudoers
View using find and perl to replace strings in a directory tree.
find ./ *.php -exec perl -pi -e 's/\/old\/tree\/path/\/new\/path\/tree/' {} \;
View sed-replace.sh
# replace 'http:' w/ 'https:' in all files within the current directory.
sed -i 's/http:/https:/g' ./*
View convert.sh
#!/usr/bin/env bash
#
# The gist example here does not perform any sanity or error checking. It's just a gist.
#
# example: resize an image file to 150px width...
# ./convert.sh example.jpg 150
#
$FILENAME=$1
$WIDTH=$2