Skip to content

Instantly share code, notes, and snippets.

View DastanIqbal's full-sized avatar
🎯
Focusing

Iqbal Ahmed DastanIqbal

🎯
Focusing
View GitHub Profile
@DastanIqbal
DastanIqbal / CircleView.java
Last active May 24, 2017 03:41
CircleView in Android
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;
public class CircleView extends View {
#!/bin/bash
#flux
xflux -l -35 -g -56 -k 2700 >/tmp/xflux.out
#xflux -l 1 -k 2700
#redshift
redshift -o -t 2700:2700 -l 0.0:0.0
#redshift -x to get normal
sudo apt-get install python3-pip
sudo pip3 install send2trash
sudo pip3 install requests
sudo pip3 install beautifulsoup4
sudo pip3 install selenium
sudo pip3 install openpyxl==2.1.4
sudo pip3 install PyPDF2
sudo pip3 install python-docx
sudo pip3 install imapclient
sudo pip3 install pyzmail
@DastanIqbal
DastanIqbal / fixUbuntuUnityMenu.sh
Created August 29, 2017 02:07
Fix: Ubuntu statusbar and docker menu not showing.
dconf reset -f /org/compiz/
setsid unity
@DastanIqbal
DastanIqbal / generateKeyHashes.sh
Last active September 11, 2017 03:49
Generate Key Hash for facebook , apps or for others
# debug or dev
keytool -exportcert -alias androiddebugkey -keystore "debug.keystore" | openssl sha1 -binary | openssl base64
# release or prod
keytool -exportcert -alias <release_alias> -keystore "<release keystore>" | openssl sha1 -binary | openssl base64
@DastanIqbal
DastanIqbal / increaseTCPPortRange.sh
Created October 28, 2017 07:56
Increase TCP port range
#find current port range type
cat /proc/sys/net/ipv4/ip_local_port_range
su
#Set new local port range
echo 1024 65535 > /proc/sys/net/ipv4/ip_local_port_range
#How to upgrade from 15.04 to 16.04
#Check package avaliablity
#http://old-releases.ubuntu.com/ubuntu/dists/
#Try this first:
#http://changelogs.ubuntu.com/meta-release
#https://help.ubuntu.com/community/EOLUpgrades
## EOL upgrade sources.list
# Required
#Add all deb in Software & Updates`> Other Software > Add
#List the folder what has changed in last 5 minutes
find . -type f -cmin 5
#This gist I created to extract data from downloaded html in seperate folder,
#fetch one string from html file & and use that string to rename file
import shutil
import glob, os
from bs4 import BeautifulSoup
wdir=os.getcwd()+"/result/Year8k9k"
for fname in ["150-N","8752-8784","8790-8891","8893-8930","8933-8979","8983-9150"]:
os.chdir(wdir+"/"+fname)
import requests
import time
headers = {
'Referer': <your referer url>,
'Content-Type' : "application/x-www-form-urlencoded"
}
url=<your target url>
for x in range(<this was my range 11K,12K>):