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 python | |
# | |
# Init script skeleton for Python-based service control scripts | |
# | |
# chkconfig: 123456 1 99 | |
# description: My service | |
# | |
# Author: Josh Johnson <lionface dot lemonface at gmail dot com> | |
# | |
# |
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/bash | |
# | |
### BEGIN INIT INFO | |
# Provides: cloud-client-ui | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Should-Start: $network $time | |
# Should-Stop: $network $time | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
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 bash | |
# dropbox service | |
DROPBOX_USERS="" # space-separated usernames | |
DAEMON=.dropbox-dist/dropbox | |
NICE=19 # -20 - 19 | |
IONICE_CLASS=3 # 0 - 3 | |
IONICE_PRIOR=7 # 0 - 7 | |
KERNEL=`uname -s` |
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 bash | |
if [ $# -ne 1 ]; then | |
exit 1 | |
fi | |
filetype=`file -b "$1" | awk '{print $1}'` | |
if [ x$filetype == x ]; then | |
msg="ERROR: Could not determine the file type of \"$1\"" |
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 bash | |
ADDRESS="https://" | |
API_KEY="" | |
SECRET_KEY="" | |
USE_XMLLINT=0 # true => 1, false => 0 | |
if [ x$ADDRESS == x ] || [ x$API_KEY == x ] || [ x$SECRET_KEY == x ] || [ x$USE_XMLLINT == x ]; then | |
echo 'ERROR: Set all required valiables.' | |
exit 1 |
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 bash | |
DROPBOX_PATH="$HOME/Dropbox" | |
PREEXEC='sudo' | |
DUSTBOX='/tmp/rm' | |
DELETE_METHOD="$PREEXEC mv {} $DUSTBOX" | |
mkdir -p $DUSTBOX | |
$PREEXEC find $DROPBOX_PATH -name '*conflicted copy*' -exec $DELETE_METHOD \; |
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
Set-ExecutionPolicy RemoteSigned -Scope Process | |
Set-Location C:\Windows\System32 | |
Start-Process -FilePath bash -ArgumentList "-c `"sudo /usr/sbin/sshd -D`"" -WindowStyle hidden |
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
% iex --sname foo --cookie elixir-example | |
Erlang R16B02 (erts-5.10.3) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] | |
Interactive Elixir (0.11.2) - press Ctrl+C to exit (type h() ENTER for help) | |
iex(foo@mba11-keith)1> |
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
# -*- coding: utf-8 -*- | |
require 'prime' | |
arr = [] | |
n = Prime.first ** nil.to_i | |
foo = Proc.new {|x| x.times do n = Prime.first(n).last end } | |
bar = Proc.new {|x| arr << [[x] * x] } | |
Prime.first.times do |i| bar.call(Prime.first ** i) end | |
arr.flatten.map {|x| foo.call(x)} | |
puts n |
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
# -*- coding: utf-8 -*- | |
require 'spec_helper' | |
require 'prime' | |
arr = [] | |
n = Prime.first ** nil.to_i | |
foo = Proc.new {|x| x.times do n = Prime.first(n).last end } | |
bar = Proc.new {|x| arr << [[x] * x] } | |
Prime.first.times do |i| bar.call(Prime.first ** i) end | |
arr.flatten.map {|x| foo.call(x)} |
NewerOlder