Skip to content

Instantly share code, notes, and snippets.

View DastanIqbal's full-sized avatar
🎯
Focusing

Iqbal Ahmed DastanIqbal

🎯
Focusing
View GitHub Profile
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 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 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:
@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)
@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 / 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
sudo add-apt-repository ppa:bluetooth/bluez
sudo apt-get update
sudo apt upgrade
sudo apt install pulseaudio pulseaudio-utils pavucontrol pulseaudio-module-bluetooth
sudo service bluetooth restart
##https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
#apt-cache policy docker-ce
sudo apt-get install -y docker-ce
#sudo systemctl status docker //check docker status
sudo usermod -aG docker ${USER}
su - ${USER}
@DastanIqbal
DastanIqbal / ZoomLayout.java
Created December 19, 2018 04:46
Zoom In,Zoom Out,Drag child views and Drag parent view
package com.dastanapps.testcode;
/**
*
* Source: https://gist.github.com/cami7ord/0ce6f36a28d36bf17d96284f2cf75ae9
* Added Drag features for parent view
*
*/
import android.annotation.SuppressLint;
import android.content.Context;
@DastanIqbal
DastanIqbal / RenameFolders.py
Created July 2, 2019 08:44
Rename current directory folders
#!/usr/bin/python3
import os
cwd = os.getcwd()
dirs = os.listdir(cwd)
dirs.sort()
i = 0
for dir in dirs:
if os.path.isdir(dir):