Skip to content

Instantly share code, notes, and snippets.

View Iman's full-sized avatar
Busy Bee

Iman Samizadeh Iman

Busy Bee
View GitHub Profile
Iman /
Created January 23, 2022 01:10 — forked from GAS85/
How to Enable HTTP/2 in Apache 2.4 on Ubuntu 18.04


  • A self-managed VPS or dedicated server with Ubuntu 18.04 running Apache 2.4.xx.
  • A registered domain name with working HTTPS (TLS/SSL). HTTP/2 only works alongside HTTPS because most browsers, including Firefox and Chrome, don’t support HTTP/2 in cleartext (non-TLS) mode.

Step 1: Install Apache2

Iman /
Created October 12, 2021 19:36 — forked from tzmartin/
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
Iman /
Last active May 3, 2023 16:34 — forked from rafaelbiriba/
Install FFmpeg with libfdk_aac support (For Ubuntu)
#!/usr/bin/env bash
#Credit to @rafaelbiriba and @dustball
export BASE=/opt
echo "deb stretch main non-free" >> /etc/apt/sources.list
apt-key adv --keyserver hkp:// --recv-keys 5C808C2B65558117
apt-get update
apt-get -y install build-essential autoconf automake cmake libtool git \
#!/usr/bin/env bash
#find /var/www/ -name "*.png" -print0 | xargs -0 sudo chmod +w *.png
find /var/www/ -name "*.png" -print0 | xargs -0 sudo optipng -o7
#find /var/www/ -name "*.jpg" -print0 | xargs -0 sudo chmod +w *.jpg
find /var/www/ -name "*.jpg" -print0 | xargs -0 sudo jpegoptim -m 90 -t
Iman / .bash_profile
Created August 27, 2015 09:36
Git profile + git info like svn info
alias gi='~/'
Iman /
Last active May 31, 2024 20:06
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
Iman / gitHistoryClean
Last active August 29, 2015 14:24
Clean git history after file deleted from git
# remove all paths passed as arguments from the history of the repo
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch config/*.ini" HEAD
# remove the temporary history git-filter-branch otherwise leaves behind for a long time
rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune
git filter-branch -f --index-filter "git rm --cached --ignore-unmatch app/config/*.ini" --prune-empty -- --all
Iman / ipHealthTest.cs
Last active December 19, 2015 15:29
Validate alive IP address in C# (IP health test)
using System;
using System.Net;
using System.Threading;
using System.Net.Sockets;
class test2 {
private static readonly string[] listA = new string[] {"", "", "2607:f8b0:4003:c00::6a", "foo"};
private static bool IsIP4;
private static bool isUp;
Iman / gpg-agent daemon
Created December 4, 2012 16:54
gpg-agent daemon
#### GPG-AGENT stuff
####export $GET_TTY
# Decide wether to start gpg-agent daemon.
Iman / CP progress bar
Created February 3, 2012 11:23
Progress bar for CP
strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \
| awk '{
count += $NF
if (count % 10 == 0) {
percent = count / total_size * 100
printf "%3d%% [", percent
for (i=0;i<=percent;i++)