Skip to content

Instantly share code, notes, and snippets.

View mc256's full-sized avatar
🤗
follow the rabbit

Jun Lin (Michael) Chen mc256

🤗
follow the rabbit
View GitHub Profile
@proudlygeek
proudlygeek / nfs-tunnel.md
Last active October 2, 2024 08:26
Mount NFS Folder via SSH Tunnel

1. Install NFS on Server

Install the required packages (Ubuntu 12.04):

apt-get install nfs-kernel-server portmap

2. Share NFS Folder

Open the exports file:

vim /etc/exports
@Illvili
Illvili / collapsible-fix.css
Last active August 29, 2015 14:13
collapsible-fix
.mw-collapsible.wikitable {
display:table;
}
.mw-collapsible.wikitable img {
max-width:100%;
}
.mw-collapsible > tbody > tr:first-child > th {
position:relative;
padding-left:3em;
}
<?php
// 地址配置
$iOSAPPStoreLink = '[iOS APP Store Link here]';
$AndroidLink = '[APK Link here]';
function redirect($url) {
header('Location: ' . $url);
exit();
}
@ralavay
ralavay / vim-nginx-conf-highlight.sh
Last active November 5, 2024 02:16
Enable syntax highlight for Nginx conf file in Vim
#!/bin/bash
#
# Highligh Nginx config file in Vim
# Download syntax highlight
mkdir -p ~/.vim/syntax/
wget http://www.vim.org/scripts/download_script.php?src_id=19394 -O ~/.vim/syntax/nginx.vim
# Set location of Nginx config file
cat > ~/.vim/filetype.vim <<EOF
@NSURLSession0
NSURLSession0 / cloudkit-server.php
Created February 7, 2016 21:36
CloudKit server-to-server in PHP
<?php
// Constants
$KEY_ID = 'YOUR_KEY_ID';
$CONTAINER = 'YOUR_CONTAINER';
$PRIVATE_PEM_LOCATION = 'eckey.pem'; // Store this file outside the public folder!
// Config
$url = 'https://api.apple-cloudkit.com/database/1/' . $CONTAINER . '/development/public/records/query';
$body = '{"query":{"recordType":"Articles"}}';
module alu4bits;
input [8:0]a,b;
input [3:0]sel;
output [8:0]z;
reg [8:0]z;
always @(sel,a,b)
begin
case(sel)
4'b0000: z = a + b;
4'b0000: z = a - b;
@muendelezaji
muendelezaji / bash-to-zsh-hist.py
Created October 5, 2016 14:18 — forked from op/bash-history-to-zsh-history.py
Convert Bash history to Zsh history
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is how I used it:
# $ cat ~/.bash_history | python bash-to-zsh-hist.py >> ~/.zsh_history
import sys
import time
@hfs
hfs / git2debchangelog.sh
Created October 12, 2016 09:53
Convert git log into changelog in Debian format
#!/bin/bash
#
# Convert git log into changelog in Debian format
#
# Tags in format 1.2.3-4 become version entries. Log entries between them
# become changelog entries. Merge commits are not excluded, so you probably
# have to clean up the result manually.
RE_VERSION='^v\?[0-9]\+\([.-][0-9]\+\)*'
# Assume the name of the current directory is the package name
@MichalZalecki
MichalZalecki / Dockerfile
Last active January 25, 2023 23:23
Install oh-my-zsh in Docker
RUN ["apt-get", "update"]
RUN ["apt-get", "install", "-y", "zsh"]
RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true
# docker exec -it my-app-container /bin/zsh
@EfratVil
EfratVil / CIMIS_Station_125.csv
Last active May 15, 2019 17:28
Brush & Zoom line chart
Date Eto Precip Sol_Rad Vap_Pres Air_Temp Rel_Hum Wind_Speed Wind_Dir Soil_Temp
1/1/2014 01:00 0 0 0 0.5 3.1 70 1.4 50 10.6
1/1/2014 02:00 0 0 0 0.5 3.2 68 1.2 51 10.4
1/1/2014 03:00 0 0 0 0.5 1.6 75 0.9 44 10.3
1/1/2014 04:00 0 0 0 0.5 1 77 1 47 10.1
1/1/2014 05:00 0 0 0 0.5 2.3 69 1.2 73 10
1/1/2014 06:00 0 0 0 0.5 0.7 75 0.9 54 9.8
1/1/2014 07:00 0 0 1 0.5 1 74 1.1 64 9.7
1/1/2014 08:00 0 0 20 0.5 1.3 73 1 48 9.6
1/1/2014 09:00 0.07 0 199 0.6 5 69 1 356 9.5