Skip to content

Instantly share code, notes, and snippets.

@dearmark
dearmark / Readme.md
Created September 8, 2022 05:14 — forked from OlivierLDff/Readme.md
🚀 Git Bash Emojis (Windows)

Open git bash with admin privilege.

cd "C:/Program Files/Git/usr/share/mintty"
mkdir -p emojis
cd emojis
curl https://raw.githubusercontent.com/wiki/mintty/mintty/getemojis > getemojis
./getemojis -d
@dearmark
dearmark / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@dearmark
dearmark / si.rb
Last active August 29, 2015 14:07 — forked from rasefon/si.rb
require 'RMagick'
$scale_size = 256.0
$img_fn1 = ARGV[0]
$img_fn2 = ARGV[1]
$scale_size = ARGV[2].to_f if ARGV[2]
def calculate_threshold(img_fn)
dir_name = File.dirname(img_fn)

本文完全参照 http://bbs.pcbeta.com/forum.php?mod=viewthread&tid=1420886 ,两者原理一样,内容大同小异,本文方便没有 osx 系统和初次安装的人。

本文适用范围:thinkpad t410 配有独显的型号,并且机器上原来只有 windows 8.1 (或者 7 或者 8,xp 不知道能否成功)系统,并且硬盘有足够空间,并且硬盘是 mbr 分区的。除非你知道你自己在干什么,以上条件缺一不可。

本文涉及到的帖子为:

请预先下载以下文件:

@dearmark
dearmark / l2tp.sh
Created May 5, 2014 23:54 — forked from yaoyi/l2tp.sh
#!/bin/bash
if [ $(id -u) != "0" ]; then
printf "Error: You must be root to run this tool!\n"
exit 1
fi
clear
printf "
####################################################
# #
#!/bin/sh
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
set -e
# Must be a valid filename
NAME=shadowsocks_client
PIDFILE=/var/run/$NAME.pid
#This is the command to be run, give the full pathname
DAEMON=/opt/ShadowSPDY/bin/splocal
import requests
import sys
import re
import urllib
cookie = {'PHPSESSID': 'phulssv3eg4bijf3cb423beve4'}
def get_lesson_urls(html):
urls = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', html)
return [url for url in urls if 'lesson' in url]
#################################
#
# 本清单基于 ubuntu 12.04,
# 下个 ubuntu 的 LTS
# 发出来后,会相应更新这里的内容。我的目标是按步执行可以零错误完成安装。
# 注意,本文件只是一个清单,不是一个可以安全执行的脚本
#
#################################
# create a linode,login as root, and create a common user for all the tasks
#################################
#
# 本清单基于 ubuntu 12.04,
# 下个 ubuntu 的 LTS
# 发出来后,会相应更新这里的内容。我的目标是按步执行可以零错误完成安装。
# 注意,本文件只是一个清单,不是一个可以安全执行的脚本
#
#################################
# create a linode,login as root, and create a common user for all the tasks