Skip to content

Instantly share code, notes, and snippets.

View SharkyRawr's full-sized avatar
🦄
Rawr

Sophie SharkyRawr

🦄
Rawr
View GitHub Profile
@endolith
endolith / Has weird right-to-left characters.txt
Last active June 1, 2024 10:58
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@marc0der
marc0der / install_jdk170.sh
Created April 7, 2011 17:46
Install Java 7 binary snapshot release with update-alternatives on debian/ubuntu
wget -c http://www.java.net/download/jdk7/archive/b136/binaries/jdk-7-ea-bin-b136-linux-x64-31_mar_2011.tar.gz
sudo tar zxvf jdk-7-ea-bin-b136-linux-x64-31_mar_2011.tar.gz -C /usr/local
sudo update-alternatives --install /usr/bin/java java /usr/local/jdk1.7.0/bin/java 1 --slave /usr/local/man/man1/java.1 java.1 /usr/local/jdk1.7.0/man/man1/java.1
sudo update-alternatives --install /usr/bin/javac javac /usr/local/jdk1.7.0/bin/javac 1 --slave /usr/local/man/man1/javac.1 javac.1 /usr/local/jdk1.7.0/man/man1/javac.1
@timmyomahony
timmyomahony / nginx.conf
Created June 26, 2011 13:29
Python, UWSGI, Supervisor & Nginx
upstream uwsgi {
ip_hash;
server 127.0.0.1:40000;
}
server {
listen 80;
server_name www.domain.com;
root /sites/mysite/;
access_log /sites/mysite/log/nginx/access.log;
@badsyntax
badsyntax / timeago.js
Created March 26, 2012 13:06
Javascript date time ago
Ext.Date.fuzzy = function(time, local){
(!local) && (local = Date.now());
if (typeof time !== 'number' || typeof local !== 'number') {
return;
}
var
offset = Math.abs((local - time)/1000),
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active June 16, 2024 09:00
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

#!/usr/bin/perl -w
#
# Uses ipmitool(1) to display a string of text on
# the front chassis display of Dell PowerEdge
# servers.
#
# Jesper Nyerup <nyerup@gmail.com>
my $ipmitool = '/usr/bin/ipmitool';

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns                     on recent CPU
L2 cache reference ........................... 7 ns                     14x L1 cache
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns                     20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs 4X memory

@kimus
kimus / ufw.md
Created March 2, 2014 22:46
NAT and FORWARD with Ubuntu’s ufw firewall

UFW

I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.

Install UFW

if ufw is not installed by default be sure to install it first.

@schnell18
schnell18 / cgitrc-sample
Created April 10, 2014 14:59
cgitrc sample file with instruction to generate absolute link URL starting with /cgit.cgi/
# Make cgit generate link using absolute URL
virtual-root=/cgit.cgi/
# Enable caching of up to 1000 output entriess
cache-size=1000
# cache time to live
cache-dynamic-ttl=5
cache-repo-ttl=5