This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#List the folder what has changed in last 5 minutes | |
find . -type f -cmin 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |