Skip to content

Instantly share code, notes, and snippets.

View thefotios's full-sized avatar
💭
definitely snacking

Fotios Lindiakos thefotios

💭
definitely snacking
View GitHub Profile
fotios:~ $ rhc sshkey list
Password: ********
RESULT:
Name: 5b85c379
Type: ssh-rsa
Fingerprint: 5b:85:c3:79:11:2d:ac:89:5e:77:41:e2:54:e5:18:46
fotios:~ $ ssh-add -l
2048 5b:85:c3:79:11:2d:ac:89:5e:77:41:e2:54:e5:18:46 /home/fotios/.ssh/id_rsa (RSA)
@thefotios
thefotios / install_mosh.sh
Created July 17, 2012 19:44 — forked from eerohele/mosh-cygwin.md
Compiling Mosh (http://mosh.mit.edu/) under Cygwin
#!/usr/bin/env bash
fetch_and_install(){
# Make a temporary directory for all installation files
OUT=$(mktemp /tmp/mosh_install.XXX) || { echo "Failed to create temp file"; exit 1; }
pushd $OUT > /dev/null
curl -o package.tar.gz $1
tar xvzf package.tar.gz /tmp/ -C package
pushd package > /dev/null
./configure $2
--- !omap
- Architecture: noarch
- Cart-Data: !map:BSON::OrderedHash {}
- Categories:
- cartridge
- Connections:
mysql-5.1-php-5.3:
Components:
- php-5.3
Started GET "/broker/rest/domains.json" for 127.0.0.1 at Thu Jul 12 10:58:32 -0400 2012
Processing by DomainsController#index as JSON
MongoDataStore.find(CloudUser, fotios@redhat.com, fotios@redhat.com)
Getting domains for user fotios@redhat.com
#<Domain:0x7f6fb5b17408>
[REQ_ID=ef80f325e5fa4a60904180a0794d71ce] ACTION=LIST_DOMAINS
Completed 200 OK in 77ms (Views: 12.4ms)
{
"version" : 1,
"requests" : [
{
"request" : {
"headers-type" : "Form",
"protocol" : "HTTPS",
"headers" : [
{
"value" : "Basic ${auth}",
@thefotios
thefotios / ruby_functions.md
Created July 11, 2012 19:26
Some awesome idiomatic Ruby functions

Check a variable against multiple functions

This runs all functions against a single variable. It will return true if any of the functions do. It rescues errors with false so we don't break in case you are expecting something, but end up with a nil.

functions = [:nil?,:empty?]
functions.map{|f| $variable.send(f) rescue false }.inject(:|)
# Run this script to create a new Rails app
# After this, just git push and you're good to go
oldname=railsapp
newname=rails_app
if [ ! -d "$newname" ]; then
# Create OpenShift app
rhc app create -a $oldname -t ruby-1.9
rhc app cartridge add -a $oldname -c mysql-5.1
@thefotios
thefotios / meeting.sh
Created June 22, 2012 20:41
This file can be used to run the most recent JNLP file you've downloaded and clean it up when you're done
#!/usr/bin/env bash
# Change this to your Download directory
dir="$HOME/Downloads"
# The name of the JNLP file
# - this will also find ones with (1), (2) and use the most recent
file="meeting.jnlp"
# Change this to your Java version
jvm="/usr/lib/jvm/jre-1.6.0-openjdk.x86_64/lib/amd64"
; Summary: OpenShift Proxy Rules
; Author: Fotios Lindiakos <flindiak@redhat.com>
; Date: 2012-06-13
;
; See http://code.google.com/p/switchy/wiki/RuleList for file syntax
; Set your proxy to squid.corp.redhat.com:8080
#BEGIN
[Wildcard]
#!/usr/bin/env ruby
require 'socket'
require 'net/http'
require 'yaml'
require 'benchmark'
require 'optparse'
include Benchmark
DEFAULT_TIMEOUT = 300