Skip to content

Instantly share code, notes, and snippets.

View McKay1717's full-sized avatar
💭
I may be slow to respond.

McKay1717

💭
I may be slow to respond.
View GitHub Profile
#/bin/bash
if [ "$#" -ne 3 ]; then
echo "Illegal number of parameters"
echo "Usage: autoconfig.sh ip block hostame"
echo "Exemple: autoconfig.sh 177.20.20.4 172.20.20.0 tpreseau4"
exit 1
fi
ip=$1
@McKay1717
McKay1717 / alexatopsites.rb
Last active October 10, 2015 14:36 — forked from eladkehat/alexatopsites.rb
Get the list of top sites for a given country from Alexa
# Get the list of top sites for a given country from Alexa, found here:
# http://www.alexa.com/topsites/countries/<country code>
# and transform it into a nice text file, one domain per line.
# Supply the country code as the first argument. Defaults to US.
require 'rubygems'
require 'open-uri'
require 'nokogiri'
BASE_URL = "http://www.alexa.com/topsites/countries"
country = ARGV[0] || "FR"
@McKay1717
McKay1717 / Uniqid
Created August 18, 2014 21:23
PHP uniqid in JAVA
public class Uniqid {
/***
* Copy of uniqid in php http://php.net/manual/fr/function.uniqid.php
* @param prefix
* @param more_entropy
* @return
*/
public String uniqid(String prefix,boolean more_entropy)
{
@McKay1717
McKay1717 / Uniqid
Created August 18, 2014 21:22
PHP uniqid in JAVA
public class Uniqid {
/***
* Copy of uniqid in php http://php.net/manual/fr/function.uniqid.php
* @param prefix
* @param more_entropy
* @return
*/
public String uniqid(String prefix,boolean more_entropy)
{
@McKay1717
McKay1717 / Uniqid
Created August 18, 2014 21:22
PHP uniqid in JAVA
public class Uniqid {
/***
* Copy of uniqid in php http://php.net/manual/fr/function.uniqid.php
* @param prefix
* @param more_entropy
* @return
*/
public String uniqid(String prefix,boolean more_entropy)
{