Skip to content

Instantly share code, notes, and snippets.

View akash0x53's full-sized avatar
🚀
Watching Rockets

Akash Shende akash0x53

🚀
Watching Rockets
View GitHub Profile
@akash0x53
akash0x53 / gist:e78b7562bd290d7456930c93adffcfef
Created November 17, 2023 09:11
CocInstall failed due to cert error
Use command :CocConfig to edit coc-settings.json, add
{
"https.rejectUnauthorized": false,
"http.proxyStrictSSL": false
}
@akash0x53
akash0x53 / zwstr.py
Created April 26, 2018 07:12
String to Zero-width-string
char_map = {'1': u'\u200C', '0': u'\u200B'}
def str_to_zwstr(inp):
bininp = ''.join(map(lambda x:bin(x).lstrip('0b'), map(ord, inp)))
return ''.join(map(lambda x:char_map[x], bininp))
@akash0x53
akash0x53 / genpass.sh
Created February 2, 2018 07:44
Generate random password
genpass()
{
#usage: genpass some-random-website.com 12
#generate random password for some-random-website.com and saves in ~/.pass
FOR=$1
LEN=$2
shift
if [ "$LEN" == "" ];then
LEN=8

Keybase proof

I hereby claim:

  • I am akash0x53 on github.
  • I am akash0x53 (https://keybase.io/akash0x53) on keybase.
  • I have a public key whose fingerprint is C28B 886D E4E1 BF10 8455 8568 1CC7 6E55 586B 5E22

To claim this, I am signing this object:

@akash0x53
akash0x53 / genpass
Created June 3, 2017 07:25
Generate random password and copy to clipboard
genpass()
{
LEN=$1
shift
if [ "$LEN" == "" ];then
LEN=8
fi
head -c200 /dev/urandom |tr -cd [:alnum:]+[\!\@\#\$]|head -c $LEN|xclip -selection c
echo "Copied to clipboard"
}
def users=
[
[name: "User1",
email: "user@example.com"
],
]
import hudson.tasks.Mailer
users.each{
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
@akash0x53
akash0x53 / gist:2bc7e6efe089a79eb8a0
Created February 13, 2015 11:34
convert uuid.getnode to MAC address format
>>> import uuid
>>> mac="%12X" % uuid.getnode()
>>> mac
'48D224921B7C'
>>> mac[::2]
'4D2917'
>>> mac[1::2]
'8242BC'
>>> map(None, *(mac[::2], mac[1::2]))
@akash0x53
akash0x53 / gist:29113421e621753a3e67
Created February 12, 2015 18:14
Remove duplicate dict from list of dicts
a = {
"a": 123,
"b": 456
}
l = [a, a]
print l
remove_dups = [dict(t) for t in set([tuple(d.items) for d in l])]
@akash0x53
akash0x53 / extract_info.py
Created December 24, 2014 09:27
Extract key, certificate from pkcs12
def extract_cert_key(certpath=None):
"""
Extracts private key & certificate and returns as pem string.
params:
certpath = Valid P12 certificate file path.
returns:
(certificate, privatekey)
"""
import os
import getpass