Skip to content

Instantly share code, notes, and snippets.

@xezpeleta
xezpeleta / mount_vm.sh
Last active February 21, 2018 13:18
Proxmox VM Backup ./mount_vm.sh <VMID> ./umount_vm.sh <VMID>
#! /bin/sh
if [ $# -eq 0 ]
then
echo "No arguments supplied"
exit 1
fi
if [ -z "$1" ]
@xezpeleta
xezpeleta / saveconf_3C3800.py
Last active September 28, 2016 14:59
Copy 3COM switch configuration file to a TFTP server. It uses Telnet connection (usually enabled by default).
#! /usr/bin/python
'''
This script backups your 3COM
switch configuration data. It
needs a TFTP service running!
Usage: saveconf_3C3800 <host>
It works with:
@xezpeleta
xezpeleta / led.py
Created December 16, 2013 21:19
RaspberryPi - Switch on a LED (pin 4) during 1 second
#! /usr/bin/python
import RPi.GPIO as GPIO
import time
LED = 4
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(LED, GPIO.OUT)
@xezpeleta
xezpeleta / button.py
Created December 16, 2013 21:23
RPi - Print Button status (1=pushed)
#! /usr/bin/python
import RPi.GPIO as GPIO
import time
BTN = 18
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
@xezpeleta
xezpeleta / keybase.md
Created May 23, 2014 22:10
keybase.md

Keybase proof

I hereby claim:

  • I am xezpeleta on github.
  • I am xezpeleta (https://keybase.io/xezpeleta) on keybase.
  • I have a public key whose fingerprint is 19FF FA86 3AE0 A83F 3F0B EBDE B3D8 63BB E026 3114

To claim this, I am signing this object:

@xezpeleta
xezpeleta / get_dns_queries.sh
Last active August 29, 2015 14:02
Get DNS queries to my local DNS server
#
# Let's check who is still using my old DNS server (192.168.10.1)
#
tcpdump -n -s 1500 -i eth0 udp dst port 53 and dst host 192.168.10.1
@xezpeleta
xezpeleta / example.py
Created July 10, 2014 20:40
Python library for sending data to Phant (data.sparkfun.com). https://bitbucket.org/boomlinde/pyphant/overview
import phant
import time
log = phant.factory(
'http://data.sparkfun.com/input/aGRVr0MQ4NHbwxWaZRLv?private_key=KE75BAJKR8HebZWVPr2p',
key=str,
value=int
)
i = 0
@xezpeleta
xezpeleta / 3ware.md
Last active November 3, 2015 12:44
3ware RAID disk health

3ware RAID disk health

First, install 3ware "tw-cli" utilty with apt-get from: http://hwraid.le-vert.net/

Now, show your RAID controllers

$ tw-cli show

Ctl   Model        (V)Ports  Drives   Units   NotOpt  RRate   VRate  BBU
@xezpeleta
xezpeleta / wl_cfg80211_hybrid.c
Created February 20, 2015 21:42
bcmwl-bugfix
/*
* Linux-specific portion of Broadcom 802.11abg Networking Device Driver
* cfg80211 interface
*
* Copyright (C) 2013, Broadcom Corporation. All Rights Reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
@xezpeleta
xezpeleta / pdfresize.sh
Created March 2, 2015 07:33
PDF resize
convert -density 180 -compress jpeg -resize %50 -quality 15 myfile.pdf myfile_small.pdf