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 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 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 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
| 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
| #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
| 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 |
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
| ##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} |
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.dastanapps.testcode; | |
| /** | |
| * | |
| * Source: https://gist.github.com/cami7ord/0ce6f36a28d36bf17d96284f2cf75ae9 | |
| * Added Drag features for parent view | |
| * | |
| */ | |
| import android.annotation.SuppressLint; | |
| import android.content.Context; |
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
| #!/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): |