Skip to content

Instantly share code, notes, and snippets.

View jedisct1's full-sized avatar

Frank Denis jedisct1

View GitHub Profile
@jedisct1
jedisct1 / latency.txt
Created July 8, 2012 04:18 — forked from h2oai/latency.txt
Latency numbers every programmer should know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
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
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD 150,000 ns 0.15 ms
Read 1 MB sequentially from memory 250,000 ns 0.25 ms
Round trip within same datacenter 500,000 ns 0.5 ms
aperture-2:~ alexcp$ curl --referer http://www.google.com http://www.cdn777.net/adm/login.php?l=1
<html>
<body>
<head>
<style>
#frmstyle { width:0px; height:0px; } 
</style>
</head>
#!/bin/sh
remove_dangling() {
echo "Removing dangling images ..."
docker rmi $(docker images -f dangling=true -q)
}
remove_stopped_containers() {
echo "Removing stopped containers ..."
docker rm $(docker ps -qa)
@jedisct1
jedisct1 / mingw-on-osx.sh
Last active August 29, 2015 14:24 — forked from Drakulix/mingw-w64-3.10-osx10.9.sh
Install a Windows cross-compiler on OSX
#!/bin/sh
PREFIX="/usr/local/mingw"
BINUTILS_VERSION=2.25
GCC_VERSION=5.1.0
GCC_SUFFIX_VERSION=5.1
MINGW_VERSION=4.0.2
SHA256_SUM=yolo
# check_error my_cmd --param ...
@jedisct1
jedisct1 / springer-free-maths-books.md
Created December 28, 2015 22:25 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
* Install VPS with Debian/Archinux/whatever you're comfortable with
* Get the bsd.rd file and put it in / for instance
wget ftp://ftp.openbsd.org/pub/OpenBSD/5.8/amd64/bsd.rd
* Add something along these lines in your grub.cfg (or /etc/grub.d/40_custom)
Make sure you adapt the (hd0,1) line to your config
menuentry "OpenBSD installer" {
set root=(hd0,1)
kopenbsd /bsd.rd
}
* Update the main grub.cfg:
@jedisct1
jedisct1 / get_locky.py
Created June 24, 2016 21:25 — forked from mak/get_locky.py
locky sample downloader
import sys
import hashlib
import struct
import requests
def decode(data,seed,step):
r = []
k = seed
for c in map(ord,data):
r.append(chr(c ^ k))
@jedisct1
jedisct1 / irq_balance_habrahabr.sh
Created October 24, 2016 13:05 — forked from pavel-odintsov/irq_balance_habrahabr.sh
irq_balance_habrahabr.sh
#!/bin/bash
# from http://habrahabr.ru/post/108240/
ncpus=`grep -ciw ^processor /proc/cpuinfo`
test "$ncpus" -gt 1 || exit 1
n=0
for irq in `cat /proc/interrupts | grep eth | awk '{print $1}' | sed s/\://g`
do
f="/proc/irq/$irq/smp_affinity"
@jedisct1
jedisct1 / tensorflow_gpu_gce_ubuntu_zesty.sh
Created May 31, 2017 10:15
Tensorflow 1.1 with CUDA 8.0 for GCE on Ubuntu 17.04
echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
cd /tmp # the next part is specific to your setup
# Get it here: https://developer.nvidia.com/cudnn
gsutil cp gs://tn-devel-ds/ubuntu/libcudnn5* .
ls libcudnn*.deb | sort | xargs sudo dpkg -i
sudo apt update
sudo apt install libopenblas-dev liblapack-dev python3-pip python3-pandas python3-venv python3-werkzeug

PHP-CLI (PHP en ligne de commande) sur les hébergements mutualisés OVH

(cli)

/usr/local/php5.3/bin/php  =>  PHP 5.3.29 (cli) (built: Mar  4 2016 09:03:42)
/usr/local/php5.4/bin/php  =>  PHP 5.4.45 (cli) (built: Apr 11 2016 06:20:17)
/usr/local/php5.5/bin/php  =>  PHP 5.5.35 (cli) (built: May  2 2016 07:16:01)
/usr/local/php5.6/bin/php  =>  PHP 5.6.21 (cli) (built: Apr 29 2016 07:02:48)
/usr/local/php7.0/bin/php =&gt; PHP 7.0.6 (cli) (built: Apr 29 2016 07:02:25) ( NTS )