Skip to content

Instantly share code, notes, and snippets.

View perfectfoolish's full-sized avatar
🎯
Focusing

Fulei Li perfectfoolish

🎯
Focusing
View GitHub Profile
@perfectfoolish
perfectfoolish / logrotate.conf
Created November 8, 2013 06:34
logrotate.conf refer to http://ruby-china.org/topics/3704 and manpage of logrotate
/home/git/labhub/log/*.log {
daily
missingok
rotate 5
compress
dateext
delaycompress
notifempty
copytruncate
lastaction
#/bin/bash
#########################################
#Function: auto fdisk
#Usage: bash auto_fdisk.sh
#Author: Customer service department
#Company: Alibaba Cloud Computing
#Version: 2.0
#########################################
count=0
@perfectfoolish
perfectfoolish / menu.sh
Created October 15, 2013 10:26
put this script in /usr/local/bin/, make it a command
#!/bin/bash
echo -e "\n MENU\n"
echo "1 machinename"
echo "2 machinename"
echo "3 machinename"
echo "4 machinename"
echo "5 machinename"
echo "6 machinename"
#echo -n "Enter you select(1 2 3 4 or 5):"
def call_block
puts "Start of method"
yield
yield
yield
puts "End of method"
end
@perfectfoolish
perfectfoolish / secret_token.rb
Created September 27, 2013 02:37
modify file of config/initializers/secret_token.rb for pulic code
# Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
# You can use `rake secret` to generate a secure secret key.
# Make sure your secret_key_base is kept private
require 'rubygems'
require 'rubyzip'
require 'find'
require 'zip/zip'
puts ""
puts "------------------File Search and Zip-----------------------------"
puts ""
print "Enter the search path : "
searchpath = gets
require 'find'
puts ""
puts "-----------------------File Search-----------------------------------"
puts ""
print "Enter the search path : "
searchpath = gets
searchpath = searchpath.chomp
puts ""
print "Enter the search pattern : "
pattern = gets
#!/user/bin/env bash
on_die() {
echo
echo byebye proxy
echo
networksetup -setsocksfirewallproxystate "Ethernet 2" off #close the proxy
# the name can be "wifi" or "Ethernet 1", just see what is listed in "network preference"
}
#!/usr/bin/env ruby
## for mac
#/Users/git/.rvm/rubies/ruby-1.9.3-p385/bin/ruby
require_relative '../lib/gitlab_init'
#
# GitLab shell, invoked from ~/.ssh/authorized_keys
#
#!/bin/bash
if [ `uname -m` = "x86_64" ]; then
ARCH="linux64"
else
ARCH="linux32"
fi
#AEGIS_UPDATE_SITE="http://update.aegis.aliyun.com"
AEGIS_UPDATE_SITE="http://aegis.oss.aliyuncs.com"