Skip to content

Instantly share code, notes, and snippets.

View arzzen's full-sized avatar
Focusing

arzzen

Focusing
  • ☁️
  • Ỏ̷͖͈̞̩͎̻̫̫̜͉
View GitHub Profile
@mike0004
mike0004 / show-git-branch-dates.sh
Last active January 28, 2017 11:14
show date of last commit for each branch in current repo
#!/bin/sh
# show the branches in git
for ref in $(git for-each-ref --sort=-committerdate --format="%(refname)" refs/heads/ refs/remotes ); do git log -n1 $ref --pretty=format:"%cr%d% an%n" | cat ; done | awk '! a[$0]++' | head -10
@h4cc
h4cc / array_filter_key.php
Created October 6, 2014 12:29
Filtering a PHP array by key instead of value.
<?php
/**
* Filtering a array by its keys using a callback.
*
* @param $array array The array to filter
* @param $callback Callback The filter callback, that will get the key as first argument.
*
* @return array The remaining key => value combinations from $array.
*/
@tomayac
tomayac / remoteStorage_adWordsScripts.js
Last active October 29, 2019 12:37
Remote Storage for AdWords Scripts
/**
* @author Thomas Steiner (tomac@google.com)
* @license CC0 1.0 Universal (CC0 1.0)
*
* Provides a simple key-value storage API modeled closely after
* the localStorage API in Web browsers, but tailored to AdWords Scripts.
* AdWords Scripts, due to execution time limits published at
* https://developers.google.com/adwords/scripts/docs/limits,
* forces users to store the state of a given script using either labels
* (https://developers.google.com/adwords/scripts/docs/tips#labels), or
#!/bin/bash
function list {
for branch in `git branch --remote | awk '{print $1}'`; do
last=`git log $branch | grep Author | head -1 | awk '{print $NF}'`
echo $last $branch
done
}
list | sort
@ethicalhack3r
ethicalhack3r / wp_dos.py
Created August 7, 2014 07:41
WP XML-RPC DoS Exploit
#################################################################################
# CVE-XXXXX Wordpress and Drupal XML Blowup Attack DoS#
# Author: Nir Goldshlager - Salesforce.com Product Security Team#
# This is a Proof of Concept Exploit, Please use responsibly.#
#################################################################################
#!/usr/bin/env python
from __future__ import print_function
import threading
import time
import urllib
@eugeneius
eugeneius / fast_forward_check.sh
Last active January 19, 2017 19:09
Run from a git repo to get stats on how many pull request merges could have been fast-forwarded.
#!/usr/bin/env bash
set -ue
merge_shas="`git rev-list HEAD --merges --grep='^Merge pull request #[0-9]\{1,\} '`"
merges="`echo "$merge_shas" | wc -l | tr -d ' '`"
fast_forwards=0
non_fast_forwards=0
while read -r merge_sha; do
first_parent="`git rev-list -1 $merge_sha^1`"
@centminmod
centminmod / redisinfo.sh
Last active July 29, 2022 10:00
redis server info and stats for Centmin Mod installs centminmod.com. If redis password is set in /etc/redis.conf, edit the variable REDISPASSWORD='your_redis_password'
#!/bin/bash
VER=0.0.2
#########################################################
# redis server info script for CentminMod.com
# written by George Liu (eva2000) vbtechsupport.com
#########################################################
# redis password set by requirepass in /etc/redis.conf
REDISPASSWORD=''
SOCKET=n
TRINSICTIME=10
@chriseskow
chriseskow / diceware.sh
Last active July 24, 2017 12:03
Diceware passphrase generator
#!/bin/bash
# diceware.sh -- Diceware Passphrase Generator
#
# Usage: ./diceware.sh [<num-words>]
#
# See http://www.diceware.com/
roll_die() {
echo $((0x$(head -c5 /dev/urandom | xxd -ps) % 6 + 1))
@niksumeiko
niksumeiko / git.migrate
Last active April 10, 2025 01:10
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@grzegorzblaszczyk
grzegorzblaszczyk / .gitignore
Last active May 10, 2019 18:43
Delete all but last worksheet in Google Docs Spreadsheet using Google Spreadsheet API
list_of_sheets.xml
nodes.txt