Skip to content

Instantly share code, notes, and snippets.

import glob
import platform
import unicodedata
from pathlib import Path
filename = str(Path(".") / 'Café.txt')
open(filename, 'w').write('test')
open(unicodedata.normalize('NFKD', filename), 'w').write('test')
print(platform.platform())
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:7.10
#!/bin/sed -nf
# sedtris.sed - sed tetris
# 26th of May, 2008
# Julia Jomantaite <julia.jomantaite@gmail.com>
1{
s/.*/ 2a2a2a2a|3a3a3a3a3a3a3a3a3a3a|2a2a2a2a~/
s/[^~]*~$/&&&/
s/.*/& 2a2a2a2a|0a0a0a0a0a0a0a0a0a0a|2a2a2a2a~/
s/[^~]*~$/&&&&&&&&&&&&&&&&&&&&/
s// 2a2a2a2a|4a4a4a4a4a4a4a4a4a4a|2a2a2a2a~/
@ratazzi
ratazzi / duplicate_xcode_project_target.rb
Last active December 22, 2022 14:09
Duplicate Xcode Project Target with Ruby
#!/usr/bin/env ruby
require 'rubygems'
require 'xcodeproj'
name = 'test_copy'
proj = Xcodeproj::Project.open('test.xcodeproj')
src_target = proj.targets.find { |item| item.to_s == 'test' }
@ratazzi
ratazzi / apps.rb
Created March 28, 2015 13:35
OS X 安装后的自动化设置
#!/usr/bin/env ruby
def abs_path(path)
File.symlink?(path) ? File.readlink(path) : path
end
apps = [
["/Library/Input Methods/Squirrel.app", "squirrel", false],
["{/,#{ENV['HOME']}/}Applications/Dropbox.app", "dropbox", false],
["{/,#{ENV['HOME']}/}Applications/Alfred 2.app", "alfred", false],

求职简历

个人简介

中文名:赵京松,英文名:ratazzi

年龄:25,性别:男

高中毕业后自学 PHP 以及 Linux 等开源技术,至今 PHP 工作经验1年半,Python 工作经验一年。熟练使用 Linux(三年的使用经验),现在主力是 Mac OS X。自学能力较强,英语能力良好,现正恶补英语。为成为靠谱的程序员持续努力。

<?php
/**
* 用于 Mac OS X 系统的 Automatic Proxy Configuration
* 因为 Firefox,Chrome 需要使用 SOCKS5 而 Safari 及其他程序只认 SOCKS,所以这样区分
* 也可以简单的使用 return "SOCKS5 127.0.0.1:7777;SOCKS 127.0.0.1:7777"; 这种方式
*/
$proxy = 'SOCKS';
$matches = array();
preg_match('/(Firefox|Chrome)/', $_SERVER['HTTP_USER_AGENT'], $matches);
if (!empty($matches)) {
@ratazzi
ratazzi / gist:4239543
Created December 8, 2012 09:33
OpenVPN packet header
src/openvpn/ssl.c
2598-
2599- /* get opcode and key ID */
2600- {
2601- uint8_t c = *BPTR (buf);
2602- op = c >> P_OPCODE_SHIFT;
2603: key_id = c & P_KEY_ID_MASK;
2604- }
# Makefile for dict
#
# ratazzi.potts@gmail.com
#
define zipheader
#!/bin/bash
PYTHON=$$(which python 2>/dev/null)
if [ ! -x "$${PYTHON}" ]; then
echo "Python executable not found"
@ratazzi
ratazzi / gist:2429249
Created April 20, 2012 14:50
iptables-rules.sh
# forward openvpn http to local 7777 port, squid cache
iptables -t nat -A PREROUTING -s 10.8.0.0/24 -i tun0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 7777
# VPN NAT
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
# or
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to-source 173.230.148.194
# block ip 200.164.230.186
iptables -A INPUT -s 200.164.230.186/32 -j DROP