Skip to content

Instantly share code, notes, and snippets.

View muayyad-alsadi's full-sized avatar

Muayyad Alsadi muayyad-alsadi

View GitHub Profile
diff --git a/README.md b/README.md
index f224b04..c272d09 100644
--- a/README.md
+++ b/README.md
@@ -186,7 +186,8 @@ then just `pip install dumb-init`.
## Usage
Once installed inside your Docker container, simply prefix your commands with
-`dumb-init`.
+`dumb-init` (and make sure that you're using [the recommended JSON
@muayyad-alsadi
muayyad-alsadi / debian-ssl.txt
Created June 1, 2016 20:59
openssl ciphers in linux
AES128-GCM-SHA256
AES128-SHA
AES128-SHA256
AES256-GCM-SHA384
AES256-SHA
AES256-SHA256
CAMELLIA128-SHA
CAMELLIA256-SHA
DES-CBC3-SHA
DHE-DSS-AES128-GCM-SHA256
@muayyad-alsadi
muayyad-alsadi / ssh-multi.sh
Last active October 29, 2015 12:12 — forked from dmytro/ssh-multi.sh
Start multiple synchronized SSH connections with Tmux
#!/bin/bash
# ssh-multi.sh - a script to ssh multiple servers over multiple tmux panes
# usage: type tmux then from inside tmux type ssh-multi.sh HOST1 HOST2 ... HOSTN
# Muayyad Alsadi, D.Kovalov
# https://gist.github.com/muayyad-alsadi/bd25845776bb6b4185ba/
# https://gist.github.com/dmytro/3984680
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
function error() {
@muayyad-alsadi
muayyad-alsadi / fake-runtime.spec
Created August 25, 2015 13:14
fake-runtime.spec
Name: fake-runtime
Version: 0.0.1
Release: 1%{?dist}
Summary: Fake runtime
License: GPLv2+
BuildArch: noarch
Provides: kmod
Provides: systemd = 204
Provides: systemd-sysv = 204
Provides: systemd-units = 204
@muayyad-alsadi
muayyad-alsadi / index.html
Created August 21, 2015 22:37
golang-web-demo
<html>
<head>
<title>{{.Title}}</title>
</head>
<body>
<h1>{{.Title}}</h1>
</body>
</html>
@muayyad-alsadi
muayyad-alsadi / django-dev-howto.txt
Last active September 2, 2015 13:14
how to setup your development environment for python/django
# as root
yum install python-pip python-pillow python-lxml python-psutil python-simplejson python-ldap python-crypto python-pwquality PyYAML MySQL-python python-psycopg2 libxslt-python python-greenlet python-gevent python-gevent-socketio python-gevent-websocket
pip install --upgrade pip
pip install wheel virtualenv
##################
# as usual user
###################
# install to common ~/wheels to save downloads
.pull-start {float:right;}
.pull-end {float:left;}
.text-start {text-align:right;}
.text-end {text-align:left;}
.media > .pull-start {margin-left: 10px;}
.media > .pull-end {margin-right: 10px;}
.carousel-control.prev { right: 15px; left: auto; }
.carousel-control.next { left: 15px; right: auto; }
magin-left: 500px;
becomes:
margin-left: auto;
margin-right: 500px
while
@muayyad-alsadi
muayyad-alsadi / primes.c
Last active August 29, 2015 14:03
primes in C/C++
#include <stdlib.h>
#include <alloca.h>
#include <stdio.h>
#include <sys/time.h>
int* get_primes(int n, int *l) {
char* compo=(char*)alloca(n);
int* primes=(int*)malloc(sizeof(int)*n);
int i,j,c=0;
for(i=0;i<n;++i) compo[i]=0;
@muayyad-alsadi
muayyad-alsadi / primes.py
Created July 5, 2014 18:30
primes optimizations
import time
def get_primes(n):
primes=[]
compo=set()
in_compo=compo.__contains__
add_prime=primes.append
add_compo=compo.update
for i in range(2, n):
if in_compo(i): continue