Skip to content

Instantly share code, notes, and snippets.

View rseyf's full-sized avatar

Reza Seyf rseyf

View GitHub Profile
@formido
formido / bas64 sha1 encode
Created February 10, 2011 18:11
python: base 64 encode the sha1 hash of a string
>>> import base64
>>> import hashlib
>>> base64.b64encode(hashlib.sha1("test").digest())
'qUqP5cyxm6YcTAhz05Hph5gvu9M='
@caseyohara
caseyohara / reserved_usernames.rb
Created December 9, 2011 22:58
A list of reserved usernames to avoid vanity URL collision with resource paths
# A list of possible usernames to reserve to avoid
# vanity URL collision with resource paths
# It is a merged list of the recommendations from this Quora discussion:
# http://www.quora.com/How-do-sites-prevent-vanity-URLs-from-colliding-with-future-features
# Country TLDs found here:
# http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains
# Languages found here:
@cedricwalter
cedricwalter / firewall.sh
Created January 27, 2012 20:43
Restrictive Iptables Based Firewall for Webserver script
#!/bin/bash
# Restrictive Iptables Based Firewall for Webserver script
# Copyright (C) 2012 Cédric Walter - www.waltercedric.com
# Credits to all various authors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@mariozig
mariozig / migrate_repo.sh
Last active May 26, 2024 20:57
Migrate repo from GitLab to GitHub Full blog post @ http://ruby.zigzo.com/2015/03/23/moving-from-gitlab-to-github/
# Assume we are in your home directory
cd ~/
# Clone the repo from GitLab using the `--mirror` option
$ git clone --mirror git@your-gitlab-site.com:mario/my-repo.git
# Change into newly created repo directory
$ cd ~/my-repo.git
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks.
@nexces
nexces / lnav_monolog.json
Last active December 7, 2022 03:17 — forked from skowron-line/monolog.json
lnav Monolog format
{
"monolog": {
"title": "Monolog log file format",
"description": "Monolog log file format",
"url": "https:\/\/github.com\/Seldaek\/monolog",
"regex": {
"default": {
"pattern": "\\A\\[(?<timestamp>[^\\[\\]]+)\\] (?<logger>[A-Za-z0-9-_]+)\\.(?<level>\\w+): (?<message>.+?) *(?<context>(\\[(?>[^\\[\\]]+|(?-1))*\\])|(\\{(?>[^\\{\\}]+|(?-1))*\\})) (?<extra>(?-4))\\z"
}
},
@iNamik
iNamik / list_targets-Makefile
Last active November 17, 2023 12:27
Base Makefile With Ability To List Targets
##
# Base Makefile with ability to list targets
#
.PHONY: help about list targets
ME := $(realpath $(firstword $(MAKEFILE_LIST)))
# Contains trailing '/'
#
PWD := $(dir $(ME))
@rseyf
rseyf / vim_installer.sh
Last active July 10, 2022 23:04
My VIM Customizer
# /bin/bash
# make sure this file has execution permission to run (do NOT use sudo:
# $ chmod +x vim_installer.sh
# $ ./vim_installer.sh
# =====================================================================
# install git
echo "======== VIM INSTALLER ========"
echo "MAKE SURE YOU HAVE GIT INSTALLED!"
echo "Then press any key to continue..."
@martin-helmich
martin-helmich / docker-compose.yml
Created January 11, 2020 10:52
Minimal example for using Jaeger Tracing with Go
version: "3"
services:
jaeger:
image: jaegertracing/all-in-one:1.8
ports:
- 6831:6831/udp
- 6832:6832/udp
- 5778:5778
- 16686:16686
- 14268:14268
@mehdihasan
mehdihasan / install-oc-client-ubuntu.md
Last active June 20, 2024 09:07
Install OC client in Ubuntu/Debian
@massihm
massihm / IsOdd.php
Last active November 23, 2022 16:46
isOdd Function for PHP
Function isOdd($int){
if($int == 0) return false;
if($int == 1) return true;
if($int == 2) return false;
if($int == 3) return true;
if($int == 4) return false;
if($int == 5) return true;
if($int == 6) return false;
if($int == 7) return true;
if($int == 8) return false;