Skip to content

Instantly share code, notes, and snippets.

View shellkore's full-sized avatar
🌚
Working in Stealth Mode

Shailesh Kumar Sahu shellkore

🌚
Working in Stealth Mode
View GitHub Profile
@shellkore
shellkore / squah.md
Created January 18, 2019 17:54
squash your commits

SQUASH

Whenever you want to squash last commits in a single commit:-

first check your log

git log

CASE 1: your head is at the commit in which you want others to be squashed

@shellkore
shellkore / importDriveInColab.md
Last active February 25, 2019 10:44
code to import drive in colab

from google.colab import drive

drive.mount('/content/drive')

@shellkore
shellkore / getHTTPSproxy.py
Created April 23, 2019 13:29
a code snippet to get list of HTTPS proxies from "free-proxy-list.net".
import requests
import re
proxy_url = "https://free-proxy-list.net/"
def getProxyBuffer():
headers = {'User-Agent': "Mozilla/5.0"}
source = str(requests.get(proxy_url, headers=headers, timeout=10).text)
data = [list(filter(None, i))[0] for i in re.findall("<td>(.*?)</td>|<td class='hx'>(.*?)</td>", source)]
groupings = [dict(zip(['ip', 'port', 'code', 'using_anonymous', 'https'], data[i:i + 5])) for i in
range(0, len(data), 5)]
@shellkore
shellkore / nodePathSetup.md
Created May 1, 2019 18:27
solution for problem "Installed node modules globally but still showing error"

To setup path of node modules

Installed node modules globally but still showing error

suppose you installed a node module X-module globally somehting like this node i -g X-module but still getting error when you call that module. Then you might be having NODE_PATH not pointing to your modules. To solve the problem try the following method.

Write your command to install node module globally.check

node i -g X-module

import json
def user_auth():
username=input('Enter username(reg. no.):-')
password=getpass.getpass('Enter password:-')
data={'username':username,
'password':password}
with open('data.json','w') as outfile:
json.dump(data,outfile)
@shellkore
shellkore / commitCorrection.md
Last active May 19, 2019 08:42
If you forget to change your name and email intially and made several commits. So, to correct those you can use this script.
  • copy the below code in a file and save it in .sh extension.
  • Configure your OLD_MAIL, CORRECT_NAMEand CORRECT_EMAIL and save the file.
  • This file should be in your directory whose correction you want to do.
  • run this file bash fileName.sh or ./filename
  • force push the repo. git push -f origin master
def plot_bar_x():
# this is for plotting purpose
plt.bar(countPerHour,range(24))
plt.title('Time vs ridership')
plt.xlabel('Time(Hour)')
plt.ylabel('Ridership')
plt.ion()
plt.show()
plt.pause(4)
plt.close('all')
@shellkore
shellkore / strongSignal.sh
Created June 8, 2019 06:28
Download and run this file to get strong wi-fi singal. For rtl8723de(HP i5 laptops and more)
iwlist scan | egrep -i 'ssid|quality'
sudo modprobe -r rtl8723de
sudo modprobe rtl8723de ant_sel=1
iwlist scan | egrep -i 'ssid|quality'
sudo modprobe -r rtl8723de
sudo modprobe rtl8723de ant_sel=2
iwlist scan | egrep -i 'ssid|quality'
add policy