This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Watch incoming connections with a given string | |
| strace -f -e trace=network -s 100000 -p <pid> 2>&1 | grep --line-buffered <string> -a4 -b4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Object | |
| def if?(method_symbol=nil, &block) | |
| if method_symbol.is_a?(Symbol) | |
| (self.send(method_symbol))? self : nil | |
| else | |
| (yield(self))? self : nil | |
| end | |
| end | |
| def unless?(method_symbol=nil, &block) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'erb' | |
| Dir.glob("**/*.erb").each do |erb_file| | |
| File.write(erb_file.sub(/\.erb/, ''), ERB.new(File.read(erb_file)).result) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias with-sensible-jvm='JAVA_HOME="`/usr/libexec/java_home -v '1.6*'`" $@' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "stdafx.h" | |
| #include <GL/gl.h> | |
| #include <GL/glu.h> | |
| #define MAX_LOADSTRING 100 | |
| HINSTANCE hInstance; | |
| HWND hWnd; | |
| LONG WINAPI WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { | |
| static PAINTSTRUCT ps; | |
| switch (uMsg) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "stdafx.h" | |
| #include <windows.h> | |
| #include <GL/gl.h> | |
| #include <GL/glu.h> | |
| #define MAX_LOADSTRING 100 | |
| HINSTANCE hInstance; | |
| HWND hWnd, hWnd2; | |
| struct WindowData { | |
| HWND window; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <avr/pgmspace.h> | |
| #include <IRremote.h> | |
| #include <IRremoteInt.h> | |
| #define DATA_1 (PORTC |= 0X01) | |
| #define DATA_0 (PORTC &= 0XFE) | |
| #define STRIP_PINOUT (DDRC=0xFF) | |
| #define NOP __asm__("nop\n\t"); | |
| #define NOP28 NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP | |
| #define NOP9 NOP NOP NOP NOP NOP NOP NOP NOP NOP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function killify() { | |
| if [ $# -ne 0 ]; then | |
| kill -9 `ps auxww | grep "$@" | grep -v grep | tr -s ' ' | cut -d' ' -f 2` | |
| fi | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ~ »wc -l test.txt | |
| 23759 test.txt | |
| ~ »function truncate() { echo "`tail -n100 $1`" > $1; }; truncate test.txt | |
| ~ »wc -l test.txt | |
| 100 test.txt | |
| ~ » |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| rm -f tempfifo1 | |
| rm -f a.out | |
| mkfifo tempfifo1 2>/dev/null | |
| cat << EOF > tempfifo1 & | |
| #include <stdio.h> | |
| int main(int argc, char ** argv) { | |
| printf("Hello, world!\n"); | |
| return 0; |