Skip to content

Instantly share code, notes, and snippets.

@youhide
youhide / awsAutoScalingIp
Created February 5, 2017 18:39
Get IP's of AutoScaling Group (AWS)
#!/bin/bash
for i in `aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name GROUPNAME | grep -i instanceid | awk '{ print $2}' | cut -d',' -f1| sed -e 's/"//g'`
do
aws ec2 describe-instances --instance-ids $i | grep -i PrivateIpAddress | awk '{ print $2 }' | head -1 | cut -d"," -f1
done;
@youhide
youhide / beanstalk_nginx_fastcgi_env_var.sh
Last active March 31, 2017 23:55
Pass environment variable to NGINX fastcgi on AWS ElasticBeanstalk
#!/usr/bin/env bash
. /opt/elasticbeanstalk/support/envvars
cp /etc/nginx/fastcgi_params.default /etc/nginx/fastcgi_params
. /opt/elasticbeanstalk/bin/get-config environment | python -c "import json,sys; obj=json.load(sys.stdin); f = open('/etc/nginx/fastcgi_params', 'a'); f.write('\n'.join(map(lambda x: 'fastcgi_param ' + x[0] + ' ' + x[1] + ';', obj.iteritems())))"
service httpd stop
service nginx restart
@youhide
youhide / restart-onload.sh
Created April 3, 2017 03:08
Restart something on load > 100
#/bin/bash
LOAD=$(awk '{print $1}' /proc/loadavg)
if [ $(echo "$LOAD > 100" | bc) = 1 ]; then
/etc/init.d/php-fpm restart
fi
@youhide
youhide / gaLogin.js
Last active June 24, 2017 04:45
Google Analytics Login Crawler ( CasperJS )
var casper = require('casper').create();
function getLinks() {
var links = document.querySelectorAll('a');
return Array.prototype.map.call(links, function(e) {
return e.getAttribute('href');
});
}
casper.start('https://accounts.google.com/ServiceLogin#identifier');
@youhide
youhide / add-crontab-via-cli
Last active August 16, 2017 18:07
Add crontab on the fly
crontab -l | { cat; echo "* * * * * myscript"; } | crontab -
OR
(crontab -l ; echo "* * * * * myscript")| crontab -
@youhide
youhide / github_post_recieve.php
Last active August 17, 2017 15:29 — forked from cowboy/github_post_recieve.php
GitHub PHP webhook to auto-pull on repo push
<?php
// Use in the "Post-Receive URLs" section of your GitHub repo.
if ( $_POST['payload'] ) {
shell_exec( 'cd /srv/www/git-repo/ && git reset --hard HEAD && git pull' );
}
?>hi
@youhide
youhide / subup
Created November 20, 2017 18:26
Update Git Submodules
git pull --recurse-submodules
git submodule update --remote --recursive
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// Choose either "stable" for receiving highly polished,
// or "canary" for less polished but more frequent updates
updateChannel: 'stable',
@youhide
youhide / uninstall-razer-synapse.sh
Created June 14, 2018 23:10 — forked from timotgl/uninstall-razer-synapse.sh
How to fully uninstall Razer Synapse 2 on OS X (10.11-10.13) (El Capitan, Sierra, High Sierra) without using Razer's official uninstall tool
# How to uninstall Razer Synapse 2 ( https://www.razerzone.com/synapse-2 )
# on OS X (10.11-10.13) (El Capitan, Sierra, High Sierra)
# without using Razer's official uninstall tool.
# Tested on OS X 10.11.5 in July 2016.
# Edited with additional steps for later OS X versions,
# contributed by commenters on this gist.
# Step 1: In your terminal: stop and remove launch agents
launchctl remove com.razer.rzupdater

UltimaPHP Muls List

  • tiledata.mul
  • staidxX.mul
  • staticsX.mul
  • mapdifX.mul
  • mapXLegacyMUL.uop