Skip to content

Instantly share code, notes, and snippets.

View hadisfr's full-sized avatar

H@di hadisfr

View GitHub Profile
@hadisfr
hadisfr / DE2_TOP.v
Last active October 19, 2017 13:58
some ALTERA DE2 FPGA files for Quartus II
// ============================================================================
// Copyright (c) 2012 by Terasic Technologies Inc.
// ============================================================================
// Permission:
// Terasic grants permission to use and modify this code for use
// in synthesis for all Terasic Development Boards and Altera Development
// Kits made by Terasic. Other use of this code, including the selling
// ,duplication, or modification of any portion is strictly prohibited.
@hadisfr
hadisfr / compile_kernel.bash
Last active July 20, 2018 05:48
a bash script to compile and run linux kernel using qemu and gdb - migrated to https://github.com/hadisfr/compile_kernel
#!/usr/bin/env bash
# a script to compile and run linux kernel using qemu and gdb
#
# author: hadi_sfr([email protected])
#
# Usage:
# Download .tar.gz kernel file from https://www.kernel.org/pub/linux/kernel/
# Put .tar.gz file besdie this script
# Run the script
@hadisfr
hadisfr / agnoster_bash.sh
Last active July 20, 2018 05:34
a bash theme like agnoster zsh theme - migrated to https://github.com/hadisfr/agnoster_bash
#!/usr/bin/bash
# Agnoster BASH Theme
#
# Author: H@di([email protected])
#
# Usage: 1. set a powerline-compatible font for terminal
# 2. append this file to your ~/.bash_profile
#
# • powerline-compatible fonts: https://github.com/powerline/fonts/tree/master/SourceCodePro
@hadisfr
hadisfr / bash_profile
Last active October 5, 2017 21:05
part of ~/.bash_profile
# ~/.bash_profile
alias ls='ls --color=auto'
alias grep="grep --color=auto"
alias diffstat="diffstat -C"
alias hiddneFilesShow='defaults write com.apple.finder AppleShowAllFiles YES && rm ~/.DS_Store; killall Finder /System/Library/CoreServices/Finder.app'
alias hiddneFilesHide='defaults write com.apple.finder AppleShowAllFiles NO && rm ~/.DS_Store; killall Finder /System/Library/CoreServices/Finder.app'
function aria2webui(){
@hadisfr
hadisfr / subtitle_corrcetor.sh
Last active June 5, 2018 00:17
convert subtitles' encoding from Arabic(Windows) to UTF-8
#!/usr/bin/env bash
for f in `find . -name "*.srt"`; do
iconv -f ms-arab -t utf8 $f > ${f%".srt"}.u.srt
echo -e ${f%".srt"}.u.srt
done
@hadisfr
hadisfr / pdf_stamp.sh
Last active September 10, 2023 10:39
use pdftk to stamp a pdf on another one
#!/usr/bin/env bash
# PDF Stamper Scrtipt
#
# Author: H@di ([email protected])
#
# pdftk in.pdf multistamp stamp.pdf output out.pdf
# https://www.pdflabs.com/docs/how-to-add-headers-footers-watermarks-and-stamps-to-pdf/
#