Nginx
set $stupid_spider "";
# If the request comes from one of these stupid spiders
if ($http_user_agent ~* (stupid|spider)) {
set $stupid_spider "1";
}
#! /bin/sh | |
# Update: There is no point using this, we have `etc-update' | |
for new_config in $(find /etc/ -name '._cfg????_*') | |
do | |
old_config=$(echo $new_config | sed 's:\([a-zA-Z0-9]*\)\._cfg[0-9]\{4\}_\([a-zA-Z0-9]*\):\1\2:') | |
if [[ -f "$new_config" || -f "$old_config" ]] | |
then | |
mv $new_config $old_config | |
else |
benchmarking repmat/useRepmat whnf | |
time 112.9 ms (111.7 ms .. 113.7 ms) | |
1.000 R² (1.000 R² .. 1.000 R²) | |
mean 113.3 ms (112.8 ms .. 113.9 ms) | |
std dev 724.5 μs (504.6 μs .. 955.7 μs) | |
variance introduced by outliers: 11% (moderately inflated) | |
benchmarking repmat/useReplicate whnf | |
time 101.6 ms (99.19 ms .. 104.0 ms) | |
0.999 R² (0.996 R² .. 1.000 R²) |
chef_dir = File.expand_path(File.dirname(__FILE__)) | |
cookbook_path [ | |
"#{chef_dir}/chef-cookbooks", | |
"#{chef_dir}/site-cookbooks", | |
] | |
role_path "#{chef_dir}/chef-repo/roles" |
{-# LANGUAGE DeriveFoldable #-} | |
{-# LANGUAGE DeriveTraversable #-} | |
{-# LANGUAGE TypeFamilies #-} | |
module Data.StrictList where | |
import qualified Control.Foldl as L | |
import qualified GHC.Exts | |
import Control.Foldl (Fold (Fold)) |
Nginx
set $stupid_spider "";
# If the request comes from one of these stupid spiders
if ($http_user_agent ~* (stupid|spider)) {
set $stupid_spider "1";
}
WHATEVER_NUMBER_YOU_LIKE = 42 | |
def sequence(input): | |
if input == 0: | |
return 340 | |
if input == 1: | |
return 680 | |
if input == 2: | |
return 1428 | |
if input == 3: |
Print permissions in a way that is suitable for executing again
for i in *
do
echo chown $(stat -c%U:%G $i) $i
echo chmod $(stat -c%a $i) $i
done
Add self's SSH key to another account to gain access
user=xyz
sudo mkdir -p /home/$user/.ssh
sudo cp -i ~/.ssh/authorized_keys /home/$user/.ssh/
sudo chown -R $user:$user /home/$user/.ssh
sudo chmod -R go-rwx /home/$user/.ssh
bn.BUILD_KEY: Dropbox | |
bn.VERSION: 3.12.4 | |
bn.DROPBOXEXT_VERSION: failed | |
bn.is_frozen: True | |
pid: 1414 | |
ppid: 30834 | |
ppid exe: '/nix/store/qgwrxh06c52aj17adg20wc75smg5qlay-zsh-5.0.8/bin/zsh' | |
uid: 1000 | |
user_info: pwd.struct_passwd(pw_name='phunehehe', pw_passwd='x', pw_uid=1000, pw_gid=1000, pw_gecos='Hoang Xuan Phu,,,', pw_dir='/home/phunehehe', pw_shell='/bin/bash') | |
effective_user_info: pwd.struct_passwd(pw_name='phunehehe', pw_passwd='x', pw_uid=1000, pw_gid=1000, pw_gecos='Hoang Xuan Phu,,,', pw_dir='/home/phunehehe', pw_shell='/bin/bash') |
Install Git
# Ubuntu
sudo apt-get install git
# OSX http://mac.github.com/
Create a Git repository in the current directory
# Open a terminal, `cd` to the project directory and then
git init