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 / fixgrub.txt
Created September 25, 2018 06:31
Fix grub or Ubuntu grub console issue
#Search your grub partion
#Using ls cmd
#Ex: ls -al (hd0,1)/
#Ex: ls -al (hd0,1)/<folderName>
#After finding grub folder use below cmd to fix your grub
#(hd0,1) is my grub partion
set prefix=(hd0,1)/grub
set root=(hd0,1)
insmod linux
@DastanIqbal
DastanIqbal / EZRenderer.kt
Last active February 21, 2023 12:29
Simple example of Frame Buffer Object in OpenglES
package com.iaandroid.tutsopengles.fbo
import android.graphics.BitmapFactory
import android.opengl.GLSurfaceView
import com.iaandroid.tutsopengles.R
import javax.microedition.khronos.egl.EGLConfig
import javax.microedition.khronos.opengles.GL10
/**
* Created by dastan on 11/09/2018.
@DastanIqbal
DastanIqbal / extractOpscompressed.py
Last active June 4, 2018 07:32
Extract apk, Operation , and compressed again
import zipfile
import sys
import os
import shutil
def extract(filename,extractpath="./extract/"):
if(os.path.isdir(extractpath)):
shutil.rmtree(extractpath)
zip_ref = zipfile.ZipFile(filename, 'r')
zip_ref.extractall(extractpath)
import sys
separator = "="
file = open(sys.argv[2],'w')
file.write('<?xml version="1.0" encoding="utf-8"?>\n')
file.write('<resources>\n')
with open(sys.argv[1]) as f:
for line in f:
if separator in line:
import urllib
for x in range(1,84):
y=(x+36000)
filename="0%d.mp3" % (y)
z="https://www.website.com/path/%s" % (filename)
print z
urllib.urlretrieve(z,filename)
import glob, os
import json
import MySQLdb
from bs4 import BeautifulSoup
db = MySQLdb.connect(host="localhost",
user="root",
passwd="<password>",
db="<dbname>")
cur=db.cursor()
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>):
#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)
#List the folder what has changed in last 5 minutes
find . -type f -cmin 5
#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