An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
root_DN = /CN=Esotericsystems Root Authority/C=AT/ | |
issuing_DN = /CN=Esotericsystems Issuing Authority/C=AT/ | |
passphrase: | |
echo -n changeme > $@ | |
# | |
# Create param files, keys and Self-Signed Certificate for the Root CA | |
# | |
root-ca-dsa.param: passphrase |
access_key_id: xxx | |
secret_access_key: yyy |
#!/bin/bash -ex | |
# Paste this into ssh | |
# curl -sL https://gist.github.com/andsens/2913223/raw/bootstrap_homeshick.sh | tar -xzO | /bin/bash -ex | |
# When forking, you can get the URL from the raw (<>) button. | |
### Set some command variables depending on whether we are root or not ### | |
# This assumes you use a debian derivate, replace with yum, pacman etc. | |
aptget='sudo apt-get' | |
chsh='sudo chsh' |
build/ |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
namespace :admin do | |
desc "creates and admin user" | |
task :create => :environment do | |
line = HighLine.new # a command line lib that uses erb? Bizarre. | |
line.say "<%= color('Creating a new administrative user', BOLD) %>" | |
email = line.ask("Email: ") | |
pass = line.ask("Password: " ) { |q| q.echo = "*" } | |
admin = Admin.new(:email => email, :password => pass) |
The MIT License (MIT) | |
Copyright (c) 2015 Oleg Ivanov http://github.com/morhekil | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
God.watch do |w| | |
w.name = "mysqld" | |
w.interval = 30.seconds # default | |
w.start = "service mysql start" | |
w.stop = "service mysql stop" | |
w.restart = "service mysql restart" | |
w.start_grace = 20.seconds | |
w.restart_grace = 20.seconds | |
w.pid_file = "/var/lib/mysql/hostname.pid" | |
require "test/unit" | |
class Array | |
def fifo | |
verbrauch = inject(0) {|sum, el| sum+=el.abs if el < 0; sum } | |
res = select{|el| el > 0}.inject([]) do |result, el| | |
if el > verbrauch | |
result << (el - verbrauch) | |
verbrauch = 0 | |
else |
require 'my-sinatra-app' | |
require 'sinatra/activerecord/rake' | |
desc "run irb console" | |
task :console, :environment do |t, args| | |
ENV['RACK_ENV'] = args[:environment] || 'development' | |
exec "irb -r irb/completion -r my-sinatra-app" | |
end |