Skip to content

Instantly share code, notes, and snippets.

View C-Duv's full-sized avatar

Duvergier Claude C-Duv

View GitHub Profile
#!/bin/bash
CAT="/bin/cat"
HOSTNAME=$(/bin/hostname)
RABBITMQ_HOME="/var/lib/rabbitmq"
RABBITMQ_COOKIE_PATH="$RABBITMQ_HOME/.erlang.cookie"
RABBITMQ_COOKIE=$($CAT $RABBITMQ_COOKIE_PATH) || exit 1
ERLANG_ROOT="/usr/local/erlang"
ERL_CALL="$ERLANG_ROOT/lib/erlang/lib/erl_interface-3.6.5/bin/erl_call"
PROCS=$($ERL_CALL -c $RABBITMQ_COOKIE -sname rabbit@$HOSTNAME -a 'erlang system_info [process_count]')
echo "procs.$HOSTNAME $PROCS"
@andrewrcollins
andrewrcollins / dates_times.sql
Created January 11, 2012 04:01
MySQL Dates and Times
-- ===================================================================
-- Various MySQL stored procedures for handling dates,
-- as well as populating date and time dimensions.
-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
--
-- Date Dimension
--
@Eising
Eising / findip.rb
Created February 27, 2012 13:13
Script to find IPs that belong in a list of subnets
#!/usr/bin/env ruby
require 'ipaddr'
def usage
puts "#{$0} supernets file"
puts "Checks if a file full of ip-addresses is part of a supernet \n\n"
puts "Supernets: A comma-separated list of CIDR-noted networks. NO SPACES!\n\n"
puts "Example:"
puts "#{$0} 10.0.0.0/8,172.16.0.0/12 badguys.txt"
Process.exit

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@jpatters
jpatters / HeidiDecode.js
Last active March 20, 2024 14:29
Decodes a password from HeidiSQL. HeidiSQL passwords can be found in the registry. Use File -> Export Settings to dump all settings. Great for if you forget a password.
function heidiDecode(hex) {
var str = '';
var shift = parseInt(hex.substr(-1));
hex = hex.substr(0, hex.length - 1);
for (var i = 0; i < hex.length; i += 2)
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16) - shift);
return str;
}
document.write(heidiDecode('755A5A585C3D8141786B3C385E3A393'));
@fxsjy
fxsjy / SimpleAuthServer.py
Created April 26, 2013 06:23
SimpleAuthServer: A SimpleHTTPServer with authentication
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import sys
import base64
key = ""
class AuthHandler(SimpleHTTPRequestHandler):
''' Main class to present webpages and authentication. '''
def do_HEAD(self):
@VolMi
VolMi / meld-diff.nemo_action
Created May 16, 2013 22:59
Nemo action "Compare with meld"
[Nemo Action]
Active=true
Name=Compare with meld
Name[de]=Mit meld vergleichen
Name[fr]=Comparer avec meld
Name[nl]=Vergelijk met meld
Comment=Show differences between files or directories
Comment[de]=Zeige Unterschiede zwischen Dateien oder Ordnern

Symfony2 example project with:

  • Ruby (gem): manage deps (chef, cap)
  • Opscode Chef: apply config. to target system
  • Berkshelf: manage chfe deps (cookbooks)
  • Capistrano: deploy sources to server
  • composer: deps manager for php
  • Symfony 2
  • vagrant
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active April 16, 2024 16:36
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@nocnokneo
nocnokneo / makeImage.sh
Last active February 27, 2021 15:52 — forked from bitboxer/makeImage.sh
#!/bin/bash
# A bash script to create a time machine disk image suitable for
# backups with OS X 10.6 (Snow Leopard)
# This script probably only works for me, so try it at your own peril!
# Use, distribute, and modify as you see fit but leave this header intact.
# (R) sunkid - September 5, 2009
#
# This will create a time machine ready disk image named with your
# computer's name with a maximum size of 600GB and copy it to
# /Volumes/backup. The image "file" (it's a directory, really) will