Skip to content

Instantly share code, notes, and snippets.

View bijanebrahimi's full-sized avatar

bijan bijanebrahimi

View GitHub Profile
@bijanebrahimi
bijanebrahimi / cross-compiler.sh
Last active April 17, 2024 19:54
build a linux cross compiler for FreeBSD targets
#!/bin/bash
export TARGET=amd64-marcel-freebsd9.2
export PREFIX=/usr/cross-build
export TARGET_PREFIX=$PREFIX/$TARGET
export PATH=$PATH:$PREFIX/bin
mkdir -p $TARGET_PREFIX{,/lib,/include}
mkdir build-{binutils,gmp,mpfr,mpci,gcc}
@bijanebrahimi
bijanebrahimi / README.md
Created February 20, 2017 14:03
A guide to dtrace in FreeBSD

An introduction

what's dtrace?

DTrace dynamic tracing compiler and tracing utility DTrace is a comprehensive dynamic tracing framework for the Solaris Operating System. DTrace provides a powerful infrastructure that permits administrators, developers, and service personnel to concisely answer arbitrary questions about the behavior of the operating system and user programs.

How to enable dtrace?

@bijanebrahimi
bijanebrahimi / config
Created February 28, 2016 14:41
My py3status configuration
bar {
...
status_command py3status -c ~/.config/i3/i3status.conf
font pango:DejaVu Sans Mono, Awesome 10
...
}
@bijanebrahimi
bijanebrahimi / tci-bandwith
Created August 1, 2014 20:46
‫نمایش باقیمانده ترافیک مشترکان ADSL مخابرات
#!/usr/bin/env python2.7
# Author: Bijan EBrahimi [dev-null@riseup.net]
# License: GPL 3 or later
# Published: Sat Aug 2 01:11:11 IRDT 2014
#
# Python Script to Bypass Captcha at Login page of TCI ADSL Provider
# to show remaining bandwidth.
# With Special thanks to @shabgard
#
# Dependencies:
@bijanebrahimi
bijanebrahimi / movie_organizer.py
Last active December 23, 2019 19:25
imdb movie organizer
#~/usr/bin/env python2
import os
import re
import imdb
import pickle
# TODO: use logger
ia = imdb.IMDb()
# TODO: expand ~/
cache_dir = "/home/bijan/.imdbpy/cache"
@bijanebrahimi
bijanebrahimi / i3-config
Last active October 7, 2018 14:53
Run terminator as a drop-down tiling terminal in i3-wm using scratchpad
# Add this to your i3 config (~/.config/i3/config) and restart i3 (Super+Shift+R)
exec --no-startup-id "terminator -m"
for_window [class="Terminator" title="^((?!Terminator Preferences).)*$"] move scratchpad, move position 0 0, resize set 1366 768;
bindsym F1 [class="Terminator"] scratchpad show;
@bijanebrahimi
bijanebrahimi / dn_validator.c
Last active May 25, 2018 14:40
Distinguished-Name validator in pure C
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#define PARSER_KEY 0x001
#define PARSER_VALUE 0x002
#define PARSER_ESC 0x004
#define PARSER_SPACE 0x008
@bijanebrahimi
bijanebrahimi / Get SoundCloud
Created April 7, 2014 17:33
Download SoundCloud Music from terminal
#!/bin/bash
#
# GetSoundcloud
#
# Copyright: 2014 Bijan Ebrahimi <bijanebrahimi@riseup.net>
#
# You may distribute this file 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.
#
@bijanebrahimi
bijanebrahimi / gitlab.sh
Last active February 20, 2017 14:00
Enable graphviz on gitlab markdown language
$ nano /etc/gitlab/gitlab.rb
nginx['custom_nginx_config'] = "include /var/opt/gitlab/nginx/conf/webtools.zharfpouyan.net;"
$ nano /var/opt/gitlab/nginx/conf/webtools.zharfpouyan.net
server {
listen *:80;
server_name webtools.zharfpouyan.net;
access_log /var/log/webtools.zharfpouyan.net.access.log;
error_log /var/log/webtools.zharfpouyan.net.error.log;