This file contains hidden or 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/python | |
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer | |
from os import curdir, sep, stat | |
PORT_NUMBER = 8080 | |
#This class will handles any incoming request from | |
#the browser | |
class myHandler(BaseHTTPRequestHandler): | |
This file contains hidden or 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
# -*- ruby -*- | |
# | |
# cracklib.rb - ruby bindings for cracklib | |
# | |
# Copyright (c) 2010 Kevin R. Bullock | |
# | |
# This library is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU Lesser General Public | |
# License as published by the Free Software Foundation; either | |
# version 2.1 of the License, or (at your option) any later version. |
This file contains hidden or 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
{$mode objfpc} | |
uses sysutils, fgl; | |
type | |
TMyKey = class | |
public | |
Key : String; | |
constructor Create; | |
end; |
This file contains hidden or 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 ruby | |
# | |
def update(dir, type) | |
Dir.chdir(dir) | |
puts "Going to update #{dir}" | |
system("#{type.to_s} pull") | |
Dir.chdir('..') | |
end |
This file contains hidden or 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
package main | |
import ( | |
"bytes" | |
"fmt" | |
"os" | |
"os/exec" | |
) | |
func isDir(path string) (bool, error) { |
This file contains hidden or 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
/* | |
Blink | |
Turns on an LED on for one second, then off for one second, repeatedly. | |
This example code is in the public domain. | |
*/ | |
// Pin 13 has an LED connected on most Arduino boards. | |
// give it a name: | |
int led = 13; |
This file contains hidden or 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
/* | |
Copyright (c) 2013 ik_5 <[email protected]> | |
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: |
This file contains hidden or 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
$BASE_PATH = File.expand_path(File.dirname(__FILE__) + '/..') | |
# also find your own gem files for the executable | |
$LOAD_PATH.unshift($BASE_PATH + '/lib') | |
require 'bundler' | |
ENV["BUNDLE_GEMFILE"] = $BASE_PATH + '/Gemfile' | |
Bundler.require(:default) |
This file contains hidden or 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
# start = Time.now | |
# sleep 20 | |
# finish = Time.now | |
# calc(finish - start) => [0, 0, 0, 0, 20] | |
# [weeks, days, hours, minutes, seconds] | |
# | |
def calc(seconds) | |
# weeks days hours min s | |
mul = [604800, 86400, 3600, 60, 1] | |
values = [:weeks, :days, :hours, :minutes, :seconds] |
This file contains hidden or 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 | |
seq=$(seq -s ' ' $[ $RANDOM % 8 +1 ] ) | |
hour=($(shuf --input-range=0-23 -n 8 | tr '\n' ' ')) | |
minutes=($(shuf --input-range=0-59 -n 8 | tr '\n' ' ')) | |
for i in $seq ; do | |
atime=${hour[$i - 1]}${minutes[$i - 1]} | |
$(at $atime <<< /usr/bin/runsomething) | |
done |