Skip to content

Instantly share code, notes, and snippets.

View KrustyHack's full-sized avatar
💭
┬─┬ ノ( ゜-゜ノ)

Nicolas Hug KrustyHack

💭
┬─┬ ノ( ゜-゜ノ)
View GitHub Profile
@KrustyHack
KrustyHack / rbs_change_basket_nuke.js
Last active August 29, 2015 14:07
RBS Change 3.6.8 basket nuke
(function() {
var host = "http://demo.rbschange.fr";
var lang = "/fr";
// '13159', '13291'
var shopId = "13159";
var productId = "13377";
@KrustyHack
KrustyHack / wordpress-permissions.sh
Created November 6, 2014 21:46
Wordpress correct permissions
#!/bin/bash
if [ "$1" != "" ]; then
cd $1 && chown www-data:www-data -R *;
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
else
echo "Usage: sudo ./wordpress-permissions.sh WORDPRESS_PATH \n"
echo "Example: sudo ./wordpress-permissions.sh /home/test/mywordpress \n"
fi
@KrustyHack
KrustyHack / getcouchdbdockerbymemory.sh
Created November 17, 2014 15:46
List Couchdb processes, sort by memory and display Docker name
#!/bin/bash
ps -eo pid,%mem,%cpu,user,args --sort -%mem | grep beam.smp | awk -F" " '{print $1}' | xargs -I {} cat /proc/{}/mountinfo | grep -Po "containers\/.{64}\/hostname" | awk -F"/" '{print $2}' | xargs -I {} docker inspect --format='{{.Name}}' {}
@KrustyHack
KrustyHack / maintenance.html
Last active August 29, 2015 14:10 — forked from pitch-gist/gist:2999707
Simple maintenance page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@KrustyHack
KrustyHack / ssh-add-bash
Created December 12, 2014 13:53
Start an ssh agent at login
# Put it to your .bashrc or .bash_profile
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
@KrustyHack
KrustyHack / turl.sh
Created January 27, 2015 12:34
Curl through Tor proxy with socks5
#!/bin/bash
curl --socks5 localhost:9050 $@
@KrustyHack
KrustyHack / install-nodejs-kali-linux.sh
Created January 29, 2015 09:55
Install nodeJS on Kali Linux
#!/bin/bash
sudo apt-get install python g++ make checkinstall fakeroot
src=$(mktemp -d) && cd $src
wget -N http://nodejs.org/dist/node-latest.tar.gz
tar xzvf node-latest.tar.gz && cd node-v*
./configure
sudo fakeroot checkinstall -y --install=no --pkgversion $(echo $(pwd) | sed -n -re's/.+node-v(.+)$/\1/p') make -j$(($(nproc)+1)) install
sudo dpkg -i node_*
@KrustyHack
KrustyHack / saltstack-docker-registry.sls
Created January 29, 2015 17:07
Saltstack docker sample
docker-registries:
https://my.regist.ry/v1/:
email: my@email.com
password: mypassword
username: myusername
@KrustyHack
KrustyHack / exploit-elasticsearch.py
Created April 10, 2015 13:42
Elasticsearch open port exploit (mod)
#!/bin/python2
# coding: utf-8
# Author: Darren Martyn, Xiphos Research Ltd.
# Mod: Krustyhack
# Version: 20150309.1
# Licence: WTFPL - wtfpl.net
import json
import requests
import sys
import readline