Skip to content

Instantly share code, notes, and snippets.

View beigna's full-sized avatar
🐍

Ignacio Benedetti beigna

🐍
  • Argentina
View GitHub Profile
@beigna
beigna / coso.go
Last active August 2, 2018 14:32
package main
import (
// "encoding/json"
"context"
"fmt"
"net/http"
"os"
"os/signal"
"strconv"
package main
import (
// "encoding/json"
"context"
"fmt"
"net/http"
"os"
"os/signal"
"syscall"
$ cat .local/share/xorg/Xorg.0.log
[ 41.701]
X.Org X Server 1.19.3
Release Date: 2017-03-15
[ 41.701] X Protocol Version 11, Revision 0
[ 41.701] Build Operating System: Linux 4.9.11-1-ARCH x86_64
[ 41.702] Current Operating System: Linux sache 4.11.7-1-ARCH #1 SMP PREEMPT Sat Jun 24 09:07:09 CEST 2017 x86_64
[ 41.702] Kernel command line: initrd=\initramfs-linux.img cryptdevice=/dev/sda4:disco root=/dev/mapper/disco rw
[ 41.702] Build Date: 07 April 2017 05:42:48PM
[ 41.702]
func download_file(destination string, url string) error {
fmt.Println("%s -> %s\n", url, destination)
res, err := http.Get(url)
if err != nil {
log.Println(err)
return errors.New("Can't fetch data from URL")
}
defer res.Body.Close()
@beigna
beigna / gist:8a33ca44a3d57df4fa634d8008156474
Created January 13, 2017 01:59
Traffic Shaping on EdgeMax
set traffic-policy shaper WorldIn description "Download"
set traffic-policy shaper WorldIn bandwidth 9600kbit
set traffic-policy shaper WorldIn class 10 description "interactive"
set traffic-policy shaper WorldIn class 10 bandwidth 20%
set traffic-policy shaper WorldIn class 10 ceiling 100%
set traffic-policy shaper WorldIn class 10 match dns ip destination port 53
set traffic-policy shaper WorldIn class 10 match ssh ip destination port 22
set traffic-policy shaper WorldIn class 10 match icmp
@beigna
beigna / pila.py
Last active September 27, 2016 14:01
coso loco
class Pila(object):
def __init__(self):
self._valores = []
self._maximos = []
def push(self, x):
self._valores.append(x)
ultimo_maximo = self._maximos.pop()
if x >= ultimo_maximo:
@beigna
beigna / test_obd.py
Last active July 23, 2016 04:02
An OBD 16x2 Display
import curses
from time import sleep
from random import randint
myscreen = curses.initscr()
MAX_RPM = 6500
EMPTY = chr(9617)
FULL = chr(9619)
SPEED = ((0, 0), (1,20), (21,40), (35, 60), (50, 90), (60, 145))
@beigna
beigna / load.py
Created November 18, 2015 21:53
pa los pibes
from random import randint
import time
from django.db import transaction
from mobile.models import Mobile, Phone, Handy, Tablet, MobileNetwork
from asset.models import Asset
ROWS = 1000
@transaction.atomic
@beigna
beigna / villa.js
Last active October 17, 2015 00:34
var Route = function(data) {
this.id = data.id;
this.waypoints = data.waypoints;
this._L_LatLng_list;
this._L_Polyline_obj;
};
Route.prototype._fill_L_LatLng = function() {
Traemos los heads y creamos un branch develop desde origin/develop (lo ejecutamos la primera vez).
$ git fetch origin
$ git checkout -b develop origin/develop
** Las proximas veces, como ya tenemos el branch develop localmente, siempre antes de crear un branch para un ticket nuevo corremos (parados en el branch develop):
$ git fetch origin
$ git pull
Creamos el branch del ticket, con su número y título.
$ git branch feature/Tnumber_ticket_title