This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ zcat dir/orig.gz | while read line | |
do | |
r= | |
echo $line | |
vared -p "write?(Y/n)" r | |
if [ -z "${r}" -o "${r}" = 'y' -o "${r}" = 'Y' ]; then | |
echo $line >> /tmp/extracted.log | |
echo "writed." | |
fi | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'pp' | |
require 'optparse' | |
require 'net/http' | |
require 'json' | |
Version=0.5 | |
class User | |
attr_accessor :atnd_name, :is_regular |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
distribution={} | |
task :get_dist do | |
run "test -f /etc/redhat-release && cat /etc/redhat-release || true" do |channel, stream, data| | |
if data | |
release = data.split ' ' | |
distribution[:type] = release[0].to_sym | |
distribution[:version] = release[2].to_f | |
end | |
end | |
run "test -f /etc/debian_version && cat /etc/debian_version || true" do |channel, stream, data| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#include <errno.h> | |
static const long MiB = 1024 * 1024; | |
int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOCAL_PATH := $(call my-dir) | |
include $(CLEAR_VARS) | |
LOCAL_MODULE := SQLite3Driver4AndroidSDK | |
LOCAL_SRC_FILES := SQLite3Driver4AndroidSDK.cpp | |
LOCAL_SRC_FILES += ../../../ThirdParty/sqlite3/sqlite-amalgamation.current/sqlite3.c | |
LOCAL_SRC_FILES += ../../../common/SQLiteDriverCPP.cpp | |
LOCAL_C_INCLUDES := $(JNI_H_INCLUDE) | |
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../../ThirdParty/sqlite3/sqlite-amalgamation.current |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[mazgi@Mac] $ parallel -j4 --eta curl -sLI {} \| head -1 \| grep -qi \'200 ok\' \&\& curl -LOR {} ::: http://dl.google.com/android/ndk/android-ndk-r{1..8}{"",{b-d}}-darwin-x86.tar.bz2 | |
Computers / CPU cores / Max jobs to run | |
1:local / 8 / 4 | |
Computer:jobs running/jobs completed/%of started jobs/Average seconds to complete | |
ETA % Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 47.8M 100 47.8M 0 0 3057k 0 0:00:16 0:00:16 --:--:-- 2395k | |
ETA: 1 % Total % Received % Xferd Average Speed Time Time Time Current |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cxxabi.h> | |
template<class T> | |
void func(const T& t) | |
{ | |
int status; | |
std::cout << "[" | |
<< t << "][" | |
<< typeid(t).name() << "][" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group :production do | |
gem "unicorn" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$: << 'lib' | |
require 'rubygems' | |
require 'gollum' | |
require 'gollum/app' | |
use Rack::ShowExceptions | |
Precious::App.set(:gollum_path, Dir.pwd) | |
Precious::App.set(:wiki_options, {}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |