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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<style media="screen"> | |
div { | |
display: inline-block; | |
height: 1px; | |
background-color: rgba(0, 0, 200, 0.5);; |
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 | |
# could be placed in a single line | |
A=$1; # change to something with a number, first script's arg | |
B=$((A*40/$2)); # calculates the portion in a progress bar of 40 # where $2 is the total as 2nd script's arg | |
C=$((40-B)); # left | |
B=$(printf "%${B}s"); | |
C=$(printf "%${C}s"); | |
printf "\r[${B// /#}${C// /-}] $A%%\n" $A; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<script type="text/javascript"> | |
/** | |
Copyright (C) 2015 Tomáš Havlas <[email protected]> | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or |
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
function getCookie(name) { | |
var cookieValue = null; | |
if (document.cookie && document.cookie != '') { | |
var cookies = document.cookie.split(';'); | |
for (var i = 0; i < cookies.length; i++) { | |
var cookie = jQuery.trim(cookies[i]); | |
// Does this cookie string begin with the name we want? | |
if (cookie.substring(0, name.length + 1) == (name + '=')) { | |
cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); | |
break; |
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
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
from httplib import HTTPResponse | |
from os import curdir,sep | |
#Create a index.html aside the code | |
#Run: python server.py | |
#After run, try http://localhost:8080/ | |
class RequestHandler(BaseHTTPRequestHandler): | |
def do_GET(self): |
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
import sys | |
from boto.s3.connection import S3Connection | |
from boto.s3.key import Key | |
conn = S3Connection('s3_access_key','s3_access_pwd') | |
#conn.create_bucket('first_20131025') | |
b = conn.get_bucket('first_20131025') | |
k = Key(b) |
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
import random | |
from os import urandom | |
from fractions import gcd | |
from gmpy2 import invert | |
from gmpy2 import mul | |
from gmpy2 import powmod | |
import sys | |
''' | |
Authors: Endrigo, Mauro |
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 | |
# HotSpot creating script using hostapd, dnsmasq and iptables | |
# Following instructions from: http://code.google.com/p/quickanddirty/wiki/CreatingWirelessHotspotWithLinux | |
LAN=wlan2 | |
WAN=eth2 | |
startap(){ | |
# Start | |
# Enable routing |
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 | |
for i in *.wav; do avconv -i "$i" -c libmp3lame -ac 2 -b:a 192k "`echo $i|sed 's\wav\mp3\g'`" ; done |
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
import sys | |
from time import gmtime, strftime | |
from math import sqrt | |
def isprimo(p): | |
i=long(sqrt(p)) | |
while True: | |
if p%i==0: return False | |
if i<=2: break | |
i = i - 1 |
NewerOlder