Skip to content

Instantly share code, notes, and snippets.

@venj
venj / process.rb
Created March 31, 2014 07:14
Files for process csv files to make kml.
#!/usr/bin/env ruby
require "FileUtils"
require "csv"
include FileUtils
Dir["*.csv"].each do |dat|
basename = File.basename(dat, ".csv")
outfile_name = "#{basename}.kml"
open(outfile_name, "w+") do |out|
@venj
venj / ua_test.rb
Created March 13, 2014 05:51
UPai Cloud UA Test
#!/usr/bin/env ruby
require "open-uri"
pic = "http://xxxx.b0.upaiyun.com/1/attachments/ZWg3nr1E.jpg"
open("test_no_ua.jpg", "w+") do |f|
begin
f.write(open(pic).read)
rescue Exception => e
@venj
venj / dat2kml.rb
Created March 13, 2014 05:50
Dat to KML
#!/usr/bin/env ruby
require "FileUtils"
include FileUtils
exit if ARGV.size != 1
cd ARGV[0] do
Dir["*.dat"].each do |dat|
basename = File.basename(dat, ".dat")
diff --git a/Gemfile b/Gemfile
index cd8ce57..2296549 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,4 +1,4 @@
-source "https://rubygems.org"
+source "http://ruby.taobao.org"
group :development do
gem 'rake', '~> 0.9'
@venj
venj / videos
Created December 24, 2013 01:06
Apple iOS 7 Tech Talk videos
http://devstreaming.apple.com/videos/techtalks/2013/11_App_Developer_Day_Kickoff/App_Developer_Day_Kickoff-hd.mov?dl=1
http://devstreaming.apple.com/videos/techtalks/2013/11_App_Developer_Day_Kickoff/App_Developer_Day_Kickoff-sd.mov?dl=1
http://devstreaming.apple.com/videos/techtalks/2013/11_App_Developer_Day_Kickoff/App_Developer_Day_Kickoff.pdf?dl=1
http://devstreaming.apple.com/videos/techtalks/2013/12_User_Interface_Design_for_iOS_7_Apps/User_Interface_Design_for_iOS_7_Apps-hd.mov?dl=1
http://devstreaming.apple.com/videos/techtalks/2013/12_User_Interface_Design_for_iOS_7_Apps/User_Interface_Design_for_iOS_7_Apps-sd.mov?dl=1
http://devstreaming.apple.com/videos/techtalks/2013/12_User_Interface_Design_for_iOS_7_Apps/User_Interface_Design_for_iOS_7_Apps.pdf?dl=1
http://devstreaming.apple.com/videos/techtalks/2013/13_Architecting_Modern_Apps_Part_1/Architecting_Modern_Apps_Part_1-hd.mov?dl=1
http://devstreaming.apple.com/videos/techtalks/2013/13_Architecting_Modern_Apps_Part_1/Architecting_Modern_Apps_Part_1-
@venj
venj / obf-ssh.sh
Last active December 19, 2015 04:39
Another version of obf-ssh startup script for debian. via: http://blog.slpo.net/?p=1234
#! /bin/sh
### BEGIN INIT INFO
# Provides: sshd_ofc
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: OpenBSD Secure Shell server (ofc)
### END INIT INFO
@venj
venj / obf-ssh.sh
Created July 1, 2013 05:43
obf-ssh changed from ssh start up script for debian 7.0
#! /bin/sh
### BEGIN INIT INFO
# Provides: sshd
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: OpenBSD Secure Shell server
### END INIT INFO
@venj
venj / server.rb
Last active December 17, 2015 18:59
Simple sinatra server for stream video to iOS. Now, more ruby style. :)
require "rubygems"
require "sinatra"
require "json"
set :public_folder, Dir.pwd
get "/" do
content_type 'application/json'
Dir["**/*"].select { |f| ["mp4", "m4v"].include? f.split(".").last.downcase }.to_json
end
@venj
venj / bypass.php
Created May 7, 2013 05:54
Bypass cloudflare. via http://pastebin.com/UG24rC0y (GFWed)
<form method="POST">
<title>Bypass CloudFlare</title>
<center>
</head>
<body>
<p align="center" dir="ltr"><b><font size="5" face="Tahoma">Bypass
<font color="#F68B1F">CloudFlare</font> !</font></b></p>
<select name="krz">
<option>ftp</option>
<option>direct-conntect</option>
<?php
if ($_GET["shorturl"]) {
$short_url = $_GET["shorturl"];
$ch = curl_init($short_url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_NOBODY, TRUE);
curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
/*
echo "<p>" . curl_getinfo($ch, CURLINFO_EFFECTIVE_URL) . "</p>";