Skip to content

Instantly share code, notes, and snippets.

View suvankarsarkar's full-sized avatar

Suvankar Sarkar suvankarsarkar

View GitHub Profile
@suvankarsarkar
suvankarsarkar / base58.js
Created September 2, 2019 11:32 — forked from bugventure/base58.js
Base58 encode/decode a decimal number
var alphabet = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ";
var base = alphabet.length; // base is the length of the alphabet (58 in this case)
// utility function to convert base 10 integer to base 58 string
function encode(num) {
var encoded = '';
while (num){
var remainder = num % base;
num = Math.floor(num / base);
encoded = alphabet[remainder].toString() + encoded;
@suvankarsarkar
suvankarsarkar / ssh-chroot-jail.sh
Created May 16, 2018 16:03 — forked from floudet/ssh-chroot-jail.sh
Chroot Jail for SSH Access
# Chroot Jail for SSH Access
# Tested on Ubuntu 14.04.2 LTS and Debian GNU/Linux 8 (jessie)
# Reference : http://allanfeid.com/content/creating-chroot-jail-ssh-access
#
# Had to add/change several things to make it work, including:
# - create lib64 folder
# - copy whoami dependencies that ldd doesn't show to fix 'I have no name!'
# in the customized prompt + create passwd file
#
@suvankarsarkar
suvankarsarkar / imp_statement.txt
Created March 12, 2018 11:40
docker_info_for_Dhaka_team
docker images
docker ps -a
docker build -t ub02 .
lsb_release -s -r
docker run -it --name u_fresh01 -p 80:80 -v /home/ov/docker/03/A/:/var/www/html/ ub02 bash
//docker start bash u_fresh01