Skip to content

Instantly share code, notes, and snippets.

View MS-Jahan's full-sized avatar
💭
Just #A_Computer_Nerd.

Md. Sarwar Jahan Sabit MS-Jahan

💭
Just #A_Computer_Nerd.
View GitHub Profile
@MS-Jahan
MS-Jahan / g_index_api.py
Last active July 30, 2020 09:15
Google Index Api Simple Usage with Python
from oauth2client.service_account import ServiceAccountCredentials
import httplib2
SCOPES = [ "https://www.googleapis.com/auth/indexing" ]
ENDPOINT = "https://indexing.googleapis.com/v3/urlNotifications:publish"
# service_account_file.json is the private key that you created for your service account.
JSON_KEY_FILE = "My-Project-2734ab3478ab.json" #You Json File
credentials = ServiceAccountCredentials.from_json_keyfile_name(JSON_KEY_FILE, scopes=SCOPES)
@MS-Jahan
MS-Jahan / dropbox_save_from_url.py
Last active July 30, 2020 09:16
Save files to Dropbox using url and get url from Dropbox - Python API usage
import dropbox
import time
dbx = dropbox.Dropbox('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') #Dropbox API
path = input("Enter full path of file in Dropbox: ") #root directory means /
url = input("Enter the file download link: ")
result = dbx.files_save_url(path, url)
@MS-Jahan
MS-Jahan / get_file_link_dropbox.py
Created July 30, 2020 09:18
Get download link for file in Dropbox - Python API Usage
@MS-Jahan
MS-Jahan / keybase.md
Last active December 27, 2020 08:33
keybase.md

Keybase proof

I hereby claim:

  • I am ms-jahan on github.
  • I am msjahan (https://keybase.io/msjahan) on keybase.
  • I have a public key ASAyLsAnjhRQ0BDfkETT3pcFV5K8XLpTCSuhRMojnparJAo

To claim this, I am signing this object:

@MS-Jahan
MS-Jahan / change_back_to_previous_commit.bash
Created January 8, 2021 06:04
Change (revert) back to previous commit without commit history
git reset --hard <commit_hash>
git push origin main --force # --force is important here
@MS-Jahan
MS-Jahan / Startpage_Search_Engine_URLs.txt
Last active February 11, 2021 13:35
Startpage Search Engine - Query and Suggestions URL
URL with %s in place of query:
- https://www.startpage.com/sp/search?query=%s&cat=web&pl=opensearch&language=english
Suggestions URL with %s in place of query:
- https://www.startpage.com/cgi-bin/csuggest?query=%s&limit=10&lang=english&format=json
@MS-Jahan
MS-Jahan / update.sh
Created May 19, 2021 14:06
Reinstall all packages in Arch Linux
#! /bin/sh
for pkg in $(pacman -Q | cut -d' ' -f1); do
pacman -Syu --noconfirm $pkg
done
reboot
@MS-Jahan
MS-Jahan / .bashrc
Created June 2, 2021 13:45
Add these lines to ~/.bashrc file after installing ibus
export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus
@MS-Jahan
MS-Jahan / deobfuscate.md
Created July 12, 2021 04:51
Deobfuscate 'node-bash-obfuscate'-d Bash File

Bash file obduscated using node-bash-obfuscate can be decrypted just replacing the eval word with echo (till the day of writing this gist).

Example

Actual Obfuscated Code:

z="
";Hz='echo';Gz=''\''';Lz='for ';Qz='; i+';Ez='Node';Cz=''\''I l';Uz='done';Jz='R_VA';Az='USR_';Fz='.js!';Nz=' = 0';Bz='VAR=';Kz='R';Rz='+ ))';Wz=' wor';Iz=' $US';Vz=' "It';Oz='; i ';Sz='; do';Mz='(( i';Tz=' $i';Xz='ks!"';Pz='< 10';Dz='ike ';
eval "$Az$Bz$Cz$Dz$Ez$Fz$Gz$z$Hz$Iz$Jz$Kz$z$Lz$Mz$Nz$Oz$Pz$Qz$Rz$Sz$z$Hz$Tz$z$Uz$z$Hz$Vz$Wz$Xz"

@MS-Jahan
MS-Jahan / audio_on_proot-distro.md
Last active July 12, 2021 04:57
Forward audio from proot-distro to Android (Termux)
pkg install pulseaudio
dir=$(pwd)
if grep -q "anonymous" ~/../usr/etc/pulse/default.pa
then
echo "module already present"
else
echo "load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" >> ~/../usr/etc/pulse/default.pa
fi
if grep -q "exit-idle" ~/../usr/etc/pulse/daemon.conf