Skip to content

Instantly share code, notes, and snippets.

View palashkulsh's full-sized avatar
💔
delusion of reprieve

palash kulshreshtha palashkulsh

💔
delusion of reprieve
View GitHub Profile
@palashkulsh
palashkulsh / find and rename folders and sub folders
Created November 28, 2020 09:46
rename folders and subfolders using find and rename
find . -maxdepth 2 -type d -exec rename 's/\/([1-9]\.)/\/0$1/g' {}/ \;
# it prepends zero in folder names
@palashkulsh
palashkulsh / xml attributes to elements
Created October 1, 2020 20:38
convert xml attributes to elements
http://xsltfiddle.liberty-development.net/jyH9rLX
@palashkulsh
palashkulsh / openvpn configurations
Created June 25, 2020 20:17
free openvpn configuration vpnbook
https://www.vpnbook.com/freevpn
download certificate bundle ,many dont connect or run, you will have to try many
eg. download https://www.vpnbook.com/free-openvpn-account/VPNBook.com-OpenVPN-US1.zip
unzip to a folder
go to that folder
try running
sudo openvpn --config vpnbook-us1-udp53.ovpn
if above file does not run then try with other files provided in zip
when asked for user name - vpnbook
when asked for password - B2c4V4c
@palashkulsh
palashkulsh / docker commands
Created June 8, 2020 10:12
docker commands
vault
docker run -p 8200:8200 -it --cap-add=IPC_LOCK -e 'VAULT_DEV_ROOT_TOKEN_ID=myroot' -e 'VAULT_DEV_LISTEN_ADDRESS=0.0.0.0:8200' vault
@palashkulsh
palashkulsh / gist:0e750490b0bd2767fc0267c16cb9e744
Created May 18, 2020 10:38
mitmproxy for intercepting https request
./mitmproxy --ssl-insecure --mode reverse:https://url_you_want_to_ultimately_hit:443 -p 1234
@palashkulsh
palashkulsh / utc to date conversion in excel
Created May 7, 2020 06:33
utc date format to date excel date format in excel
=DATEVALUE(LEFT(B3,10))+TIMEVALUE(MID(B3,12,8))
@palashkulsh
palashkulsh / download webpage with electron js with custom css
Created May 2, 2020 09:11
run this script after installing electron by electron index.js
const { BrowserWindow,app } = require('electron')
const fs = require('fs')
app.on('ready', function (){
let win = new BrowserWindow({ width: 800, height: 600 ,show:false})
win.loadURL('https://fs.blog/2014/04/the-heart-of-humanity/')
win.webContents.on('did-finish-load', () => {
// Use default printing options
@palashkulsh
palashkulsh / xmllint for sitemap url extraction
Created May 2, 2020 08:43
xmllint for sitemap url extraction
curl -s -XGET 'https://fs.blog/post-sitemap1.xml' | sed -e 's/xmlns=".*"//g' |xmllint --xpath '/*[local-name()="urlset"]/*[local-name()="url"]/*[local-name()="loc"]/text()' -
@palashkulsh
palashkulsh / auto scaling group filtering
Created April 6, 2020 15:31
filtering auto scaling group on the basis of tags
sudo aws autoscaling describe-auto-scaling-groups --region=ap-south-1 --query 'AutoScalingGroups[] | [?contains(Tags[?Key==`Techteam`].Value, `mall-cart`)]' | jq '.[] | "\(.AutoScalingGroupName),\(.TerminationPolicies[])"'
@palashkulsh
palashkulsh / ffmpeg
Created March 30, 2020 04:54
convert video audio format using ffmpeg
ffmpeg -i Good.Newwz.2019.Hindi.720p.HDRip.x264.mkv -acodec aac -filter_complex "channelmap=map=FL-FL|FR-FR|FC-FC|LFE-LFE|SL-BL|SR-BR:channel_layout=5.1" -vcodec copy new_Goodnews.mp4