fix APXS error
configure: error: couldn’t find APXS
apache2-prefork-dev
| upstream wordpress { | |
| server 127.0.0.1:80 weight=1 fail_timeout=120s; | |
| } | |
| server { | |
| listen 81; | |
| server_name blog.foo.bar; | |
| proxy_cache_valid 200 20m; | |
| access_log /var/log/httpd/nginx-access.log combined; |
| #!/bin/sh | |
| # set IP address with Amazon-VPC ENI(Elastic Network Interface) address and other. | |
| # get eth0/1 MAC addresses | |
| MACADDR0=`cat /sys/class/net/eth0/address` | |
| MACADDR1=`cat /sys/class/net/eth1/address` | |
| # get eth0/1 IP addresses on ENI | |
| IPADDR0=`/usr/bin/curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/${MACADDR0}/local-ipv4s/`; | |
| IPADDR1=`/usr/bin/curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/${MACADDR1}/local-ipv4s/`; | |
| # ifconfig on eth1 (ENI) | |
| /sbin/ifconfig eth1 inet ${IPADDR1} netmask 255.255.255.0 2>&1 >> /tmp/seteth1.log |
| upstream ghost_upstream { | |
| server 127.0.0.1:2368; | |
| keepalive 64; | |
| } | |
| server { | |
| listen 80; | |
| server_name example.com www.example.com; |
| /* | |
| This script is for updating the auto_increment field by an offset. The logic applied is | |
| max(AUTO_INCREMENT) + current value in the table. | |
| */ | |
| SET @db:='id_new'; | |
| select @max_id:=max(AUTO_INCREMENT) from information_schema.tables; | |
| select concat('update ',table_name,' set ', column_name,' = ',column_name,'+',@max_id,' ; ') from information_schema.columns where table_schema=@db and column_name like '%id' into outfile 'update_ids.sql'; |
| BLOCKS=$(nslookup -q=TXT _cloud-netblocks.googleusercontent.com 8.8.8.8 | awk -F "spf1 " '{print $2}' | sed -e "s/include:/\n/g" | sed -e "s/?all\"//g" | grep -v ^$) | |
| echo "$BLOCKS" | while read block; do nslookup -q=TXT $block 8.8.8.8 | awk -F "spf1 " '{print $2}' | sed -e "s/ip4:/\n/g" | sed -e "s/?all\"//g" |grep -v "^ip6:" | grep -v ^$; done ; |
| #!/bin/bash | |
| # You need: curl, jq, and ipcalc to run this. | |
| # You should already have cut, sort and uniq if you're on OS X or Linux. | |
| RANGES=$(curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq .prefixes | jq '.[] | select(.region=="us-east-1")' | jq 'select(.service=="EC2")' | jq .ip_prefix | cut -d '"' -f 2 | sort | uniq) | |
| for range in $RANGES | |
| do | |
| MIN=$(ipcalc -bn $range | grep "HostMin" | cut -d ':' -f 2) |
A Ruby script to generate simple Amazon S3 Redirection Rules XML file.
Update: There is an app for that now! Use Amazon S3 Redirector (Web app) and you can generate the XML without any knowledge about Ruby. Thanks to @rainforestapp. BTW, It's open source too.
| # download latest libevent2 and tmux sources, and extract them somewhere | |
| # (thx bluejedi for tip on latest tmux URL) | |
| # | |
| # at the time of writing: | |
| # https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
| # http://sourceforge.net/projects/tmux/files/latest/download?source=files | |
| # | |
| # install deps | |
| yum install gcc kernel-devel make ncurses-devel |