Skip to content

Instantly share code, notes, and snippets.

View ibaaj's full-sized avatar

Ismaïl Baaj ibaaj

  • Paris, France
View GitHub Profile
@despens
despens / blink_is_back.css
Created August 8, 2014 20:10
Blink tags are back, thanks to @thxlt
@vivien
vivien / imgur
Last active January 27, 2022 19:46
Shell script to upload image(s) to imgur.com
#!/bin/sh
#
# Upload image(s) to imgur.com
# Copyright (C) 2014 Vivien Didelot <vivien@didelot.org>
# Licensed under GPL version 3, see http://www.gnu.org/licenses/gpl.txt
#
# Requires "jshon":
# http://kmkeen.com/jshon/
#
# Alternatives, which suck:
@thomasfr
thomasfr / iptables.sh
Last active April 13, 2024 01:59
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active February 12, 2024 17:18
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@jeremiahsnapp
jeremiahsnapp / MITM -SSL-Proxies.md
Last active November 14, 2023 07:48
Man In The Middle (MITM) SSL Proxies - Simple ways to see traffic between an SSL server and client in clear text.

HTTP(S) specific MITM SSL Proxies

mitmproxy

mitmproxy is an excellent console app written in Python.

It is easy to use on Linux and OS X.

Use brew install mitmproxy to install it on OS X.

@brunoro
brunoro / pollard_rho.py
Created June 30, 2013 06:46
Pollard's Rho algorithm for discrete logs as described on (HAC 3.6) - http://cacr.uwaterloo.ca/hac/
#!/usr/bin/env python
# encoding: utf8
# HAC 3.61: generates x_{i+1}, a_{i+1} and b_{i+1}
# from a, b and c, partitioning the field
def step_xab(x, a, b, alpha, beta, n, Z):
s = x % 3
# S1
if s == 1:
@willurd
willurd / web-servers.md
Last active May 4, 2024 07:22
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@mkroman
mkroman / Network.cpp
Created November 17, 2011 01:42
Uncrustify configuration inspired by Google's C++ styleguide.
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <string.h>
#include <iostream>
#include <stdarg.h>
#include <stdio.h>
@tahl
tahl / installer.sh
Created June 15, 2011 06:56
Android SDK + NDK + Eclipse and ADB Installer
#!/bin/bash
#
#This script is designed to install the Android SDK, NDK, and Eclipse in Linux Mint 11 and make it easier for people that want to develop for Android using Linux.
#Script written by @ArchDukeDoug with special thanks to @BoneyNicole, @tabbwabb, and @animedbz16 for putting up with me and proofreading and/or testing the script.
#I can be reached at dougw@uab.edu, twitter, or linuxrandomly.blogspot.com
#Script version: 1.0.5
#Changelog: 1.0.5 - Fixed the Android SDK search parameters to fit the new naming scheme on http://developer.android.com/sdk
i=$(cat /proc/$PPID/cmdline)
if [[ $UID != 0 ]]; then
echo "Please type sudo $0 $*to use this."