Skip to content

Instantly share code, notes, and snippets.

View Nanodragon999's full-sized avatar
🏠
Searching for a remote work.

Norton Nanodragon999

🏠
Searching for a remote work.
  • France
View GitHub Profile
@BluntBlade
BluntBlade / base64 in bash
Last active April 4, 2019 18:56
A Bash version of Base64.
#!/bin/bash
##############################################################################
#
# Easy Qiniu Bash SDK
#
# Module: base64.sh
#
# Author: LIANG Tao
# Weibo: @无锋之刃
@BluntBlade
BluntBlade / hmac in bash
Created December 9, 2013 15:40
A Bash version of HMAC
#!/bin/bash
##############################################################################
#
# Easy Qiniu Bash SDK
#
# Module: utils/hmac.sh
#
# Author: LIANG Tao
# Weibo: @无锋之刃
@BluntBlade
BluntBlade / crc32 in bash
Last active December 2, 2020 01:55
A Bash version of CRC32
#!/bin/bash
##############################################################################
#
# Easy Qiniu Bash SDK
#
# www.qiniu.com
#
# Module: utils/crc32.sh
#
#!/usr/bin/python
# git config annex.iwebftp-hook "/usr/local/bin/git-annex-ftp.py -s prefix.iweb-storage.com -u prefix-admin -p password"
# git annex initremote iwebftp type=hook hooktype=iwebftp encryption=none
from ftplib import FTP, error_perm
import os, argparse
parser = argparse.ArgumentParser(description='Combined hook for FTP remotes in git-annex')
parser.add_argument('-s', '--server', required=True, help='the FTP host name or IP address')
@hideshi
hideshi / sqlite3.awk
Created December 28, 2013 11:43
How to use SQLite3 in Awk.
#!/usr/bin/awk -f
BEGIN {
db = "test.db"
command = "sqlite3 -noheader -separator \" \" " db " \" %s \""
create_table = "create table employee (id, name, age)"
insert1 = "insert into employee values (1, 'taro', 20)"
insert2 = "insert into employee values (2, 'hanako', 18)"
insert3 = "insert into employee values (3, 'ichiro', 26)"
select = "select * from employee order by age"
drop_table = "drop table employee"
@blackfalcon
blackfalcon / git-feature-workflow.md
Last active April 3, 2025 00:42
Git basics - a general workflow

Git-workflow vs feature branching

When working with Git, there are two prevailing workflows are Git workflow and feature branches. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited, and the focus of this article.

If you are new to Git and Git-workflows, I suggest reading the atlassian.com Git Workflow article in addition to this as there is more detail there than presented here.

I admit, using Bash in the command line with the standard configuration leaves a bit to be desired when it comes to awareness of state. A tool that I suggest using follows these instructions on setting up GIT Bash autocompletion. This tool will assist you to better visualize the state of a branc

@joseporiol
joseporiol / CharFormatConverter.java
Created January 21, 2014 14:47
ASCII to EBCDIC
public class CharFormatConverter {
static byte[] ASCII2EBCDIC = new byte[256];
static byte[] EBCDIC2ASCII = new byte[256];
static {
ASCII2EBCDIC[0x00] = (byte) 0x00;
ASCII2EBCDIC[0x01] = (byte) 0x01;
ASCII2EBCDIC[0x02] = (byte) 0x02;
ASCII2EBCDIC[0x03] = (byte) 0x03;
ASCII2EBCDIC[0x04] = (byte) 0x37;
ASCII2EBCDIC[0x05] = (byte) 0x2D;
@cirosantilli
cirosantilli / tutorial-opengl-linux-newbs.md
Last active November 1, 2018 14:22
Tutorial to compile and run OpenGL on Linux for complete Linux newbs

Tested on Ubuntu 12.04.

Should work on any recent Ubuntu, and on any distro with minor modifications.

Open up a terminal

There are many ways you can do this, the best in my opinion is Krusader's terminal emulator, but we will just use the gnome terminal emulator that comes with Ubuntu. To access it:

@rajanand02
rajanand02 / tmux.conf
Last active February 3, 2024 07:28
Tmux configurations with status bar theme
# set prefix to control-f
set -g prefix C-f
#unbind system defined prefix
unbind C-b
# helps in faster key repetition
set -sg escape-time 0
# start session number from 1 rather than 0
@caiguanhao
caiguanhao / CryptoJS-AES.md
Last active December 10, 2024 09:36
CryptoJS AES encryption/decryption JavaScript and command line examples

You can run these commands to encrypt or decrypt a string:

Command

To encrypt:

printf "Lorem ipsum dolor sit amet, ..." | \
  openssl enc -e -base64 -A -pbkdf2 -aes-256-cbc -pass pass:"my-password"

-e: Encrypt data