Skip to content

Instantly share code, notes, and snippets.

Avatar

Lin, Yong Xiang r888800009

View GitHub Profile
@branneman
branneman / better-nodejs-require-paths.md
Last active Nov 30, 2021
Better local require() paths for Node.js
View better-nodejs-require-paths.md

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@niw
niw / README.en.md
Last active Nov 30, 2021
How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac
View README.en.md

How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

Here is easy steps to try Windows 10 on ARM or Ubuntu for ARM64 on your Apple Silicon Mac. Enjoy!

NOTE: that this is current, 10/1/2021 state.

Running Windows 10 on ARM

  1. Install Xcode from App Store or install Command Line Tools on your Mac
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jexchan
jexchan / multiple_ssh_setting.md
Created Apr 10, 2012
Multiple SSH keys for different github accounts
View multiple_ssh_setting.md

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@sanchitgangwar
sanchitgangwar / snake.py
Created Mar 22, 2012
Snakes Game using Python
View snake.py
# SNAKES GAME
# Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting
import curses
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN
from random import randint
curses.initscr()
win = curses.newwin(20, 60, 0, 0)
@phrawzty
phrawzty / 2serv.py
Last active Nov 26, 2021
simple python http server to dump request headers
View 2serv.py
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
@Barneybook
Barneybook / Telegram_it_group_list.md
Last active Nov 22, 2021
Telegram 資訊相關 群組清單
View Telegram_it_group_list.md
@crunchprank
crunchprank / pass-crack-cheat-sheet.md
Created Dec 15, 2015
Cheat Sheet For Password Crackers
View pass-crack-cheat-sheet.md

Cheat Sheet For Password Crackers

This list was posted over at Unix-Ninja. I take no credit for these. Posting these here for my own convenience.

Extracting Data

Extract md5 hashes

# egrep -oE '(^|[^a-fA-F0-9])[a-fA-F0-9]{32}([^a-fA-F0-9]|$)' *.txt | egrep -o '[a-fA-F0-9]{32}' > md5-hashes.txt
# egrep -oE '(^|[^a-fA-F0-9])[a-fA-F0-9]{32}([^a-fA-F0-9]|$)' *.txt | egrep -o '[a-fA-F0-9]{32}' > md5-hashes.txt
@sourcerebels
sourcerebels / download-phrack-issues.sh
Created Feb 20, 2012
Download all Phrack Magazine Issues
View download-phrack-issues.sh
#!/bin/sh
for i in {1..67}
do
FILE="phrack${i}.tar.gz"
wget http://phrack.org/archives/tgz/${FILE}
tar xvzf ${FILE}
rm ${FILE}
done
@shijinkui
shijinkui / basecommand_emacs
Created Mar 16, 2012
Emacs常用基本快捷键
View basecommand_emacs
/************************************/
基本命令
C-x C-f 打开/新建文件
C-x C-s 保存当前缓冲区
C-x C-w 当前缓冲区另存为
C-x C-v 关闭当前Buffer并打开新文件
C-x i 光标处插入文件
C-x b 切换Buffer
C-x C-b 显示Buffer列表
C-x k 关闭当前Buffer