use strict;
use warnings;
# install pQuery:
# sudo cpanm pQuery;
use pQuery;
my $url = "";
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://\"\n</FilesMatch>\n\n" >> /etc/httpd/conf/httpd.conf;
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 -P0 -p 80,443 | grep -B 4 "open"
# commonly used http, proxy and other related ports
nmap -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/' {} \;
# replace 'http:' w/ 'https:' in all files within the current directory.
sed -i 's/http:/https:/g' ./*
#!/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...
# ./ example.jpg 150