Skip to content

Instantly share code, notes, and snippets.

http://www.cyberciti.biz/tips/linux-unix-du-command-examples.html
du command Examples
Type du to display usage in current directory :
$ du
Pass -h option to display output in Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte (Human-readable output)
$ du -h
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
; (x) Z0MBiE 2010
; 3.3.2 Run lua Protected shit
; Same Use as luafoo
; create a macro using:
; ex: /run Do("MoveForwardStart(0)")
; ex: /run Do( "CastSpellByName(\"Flash Heal\");" )
;
#include <Asm.au3>
#include <Misc.au3>
#include <Array.au3>
/**
* SocketManager - Singleton to manage multi-channel socket 'routing', need a way to merge with socket.io so client sessions aren't stored twice in memory,
*
* Requires Socket.IO-node and Socket.IO client libraries.
*
* Usage:
* in your main app.js file (or whereever you create the server)
*
* var io = require('socket.io'),
* sm = require('socketmanager');
Writing to Memory
Exploiting format string vulnerabilities is all about providing input that uses a format character that expects its value to be passed by reference and you control that reference. I used ‘%s’ to read from memory. I’m going to use %n to write to memory.
%n Number of characters written by this printf.
Lucky for us, there is a really easy way to control the number of characters written by printf. When you specify a format character, you can optionally give it an integer for the width of the format character.
%#x Number of characters prepended as padding.
We can use this to control how many characters are written by printf.
@silent1mezzo
silent1mezzo / 0fixup.md
Last active April 9, 2026 15:30 — forked from SethRobertson/index.md
On undoing, fixing, or removing commits in git

A git choose-your-own-adventure!

This document is an attempt to be a fairly comprehensive guide to recovering from what you did not mean to do when using git. It isn't that git is so complicated that you need a large document to take care or your particular problem, it is more that the set of things that you might have done is so large that different techniques are needed depending on exactly what you have done and what you want to have happen.

@vasilisvg
vasilisvg / is-ios-safari.js
Created May 2, 2012 13:20
Check if the page is viewed in the Safari browser in iOs
/*
I want to make a bubble that explains people that they can save the page to their homescreen
I want to be absolutely sure that this is Safari on an iPhone or iPad
Not a browser in a webview in a native app
Not a browser in standalone mode
Not something else
This is the closest I can get to something I kinda trust.
*/
var nav = window.navigator;
@fzzzy
fzzzy / wip-0.12.1.patch
Created August 3, 2012 22:48
tcpsocket 0.12.1
diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -388,16 +388,19 @@
// WebSettings
pref("dom.mozSettings.enabled", true);
// controls if we want camera support
pref("device.camera.enabled", true);
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@ralphschindler
ralphschindler / aop-uow-change-tracking.php
Last active November 22, 2020 04:03
A aop based Unit Of Work prototype/example with minimal code
<?php
/**
* Foo is an Entity
*/
class Foo
{
protected $bar = 'original';
public function getBar()