Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does | |
import hudson.model.*; | |
import hudson.util.*; | |
import jenkins.model.*; | |
import hudson.FilePath.FileCallable; | |
import hudson.slaves.OfflineCause; | |
import hudson.node_monitors.*; | |
for (node in Jenkins.instance.nodes) { |
def generate_valid_isbn | |
prefix = 978.to_s # must be 978 or 979 | |
registration_group_element = rand(10).to_s | |
registrant_element = (rand(90000) + 10000).to_s | |
publication_element = (rand(900) + 100).to_s | |
_isbn = prefix + registration_group_element + registrant_element + publication_element | |
check_digit = 0 | |
i = 0 | |
_isbn.each_char do |letter| | |
i+= 1 |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
var ISBN = (function(){ | |
"use strict"; | |
var validateISBN13 = function(isbnChars){ | |
var checksum = 0; | |
isbnChars.forEach(function(isbnChar, key){ | |
checksum += parseInt(isbnChar, 10) * (key % 2 === 1 ? 3 : 1); | |
}); |
# YouTube playlist audio retreiver and iTunes-compliant podcast XML generation tool. | |
# This script will download each video file from the specified YouTube playlist, losslessly extract | |
# the audio, delete the video, and ultimately produce an iTunes-compliant podcast XML with the | |
# appropriate metadata, including chapter markers (if provided in the description). If you run the | |
# script again, only videos that haven't already been converted will be downloaded, allowing you to | |
# schedule the script to run as often as needed without stressing your internet connection or | |
# hard drive space. After generating the files and xml, you can easily host them on a local server | |
# in order to use them with iTunes or your favorite podcast aggregator -- but that's beyond this | |
# script's jurisdiction. |
package EasyJSON | |
import net.minidev.json.JSONValue | |
import net.minidev.json.JSONArray | |
import net.minidev.json.JSONObject | |
import scala.collection.JavaConversions._ | |
object JSON { | |
def parseJSON(s: String) = new ScalaJSON(JSONValue.parse(s)) |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
import javax.mail.Authenticator; | |
import javax.mail.Flags; | |
import javax.mail.Folder; | |
import javax.mail.Message; | |
import javax.mail.MessagingException; | |
import javax.mail.PasswordAuthentication; | |
import javax.mail.Session; | |
import javax.mail.Store; | |
import javax.mail.internet.InternetAddress; | |
import javax.mail.search.FromTerm; |
# To check if this is up-to-date with the tax rates go to | |
# http://www.expatax.nl/tax-rates-2016.php and see if there's anything | |
# newer there. | |
# | |
# I make no guarantees that any of this is correct. I calculated this | |
# at the time and have been updating it when new tax rates come along | |
# because people keep finding this useful. | |
# | |
# There's also an interactive JS version of this created by | |
# @stevermeister at |
apt-get install xvfb | |
apt-get install firefox |