Skip to content

Instantly share code, notes, and snippets.

View javierwilson's full-sized avatar

javier wilson javierwilson

  • Managua, Nicaragua
View GitHub Profile
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQENBFOHkbcBCADZO1tfHU2UIvJK/hyTmcBb51baUzYsJ1sZX3n2PxMzZ7l7gwae
oHBUcIjctO0wwYPMV1FYPe5fAoVMTYaxxBX+ltr7QAKOQNCF/ybRoqjFD1rI58if
ews54++uBKNBxBwRwye5kQLXqsrFfzMQgxR3go2NZrJEsdJjyYDTmZkKOoURS9MV
7q4KaOp8gweHi1KIXHwnpU1VzHO//yIy/XLKvE7GGHknLac2Ztrz7w5PVJgauGUp
M5dkF5Vy75DumAasU0htpweV2HSSCC2+o3PwEeYurEyZ+ECuNucSSIhiB8LxU0Y+
fCvF6c65B17WXIno9XYFfp/XziKVkMudUhCdABEBAAG0IUphdmllciBXaWxzb24g
PGphdmllckBndWVndWUubmV0PokBPgQTAQIAKAUCU4eRtwIbAwUJEswDAAYLCQgH
bash-completion
bc
bind-utils
net-tools
elinks
ethtool
ftp
binutils
dropbear
htop
#!/bin/bash
BACKUP_DIR="/var/lib/mysql/backup"
if [ -n "`pidof mysqld`" ] && [ -f "/var/lib/mysql/.my.cnf" ]; then
mkdir -p $BACKUP_DIR
chown mysql $BACKUP_DIR
# backup datqabases
# please create /var/lib/mysql/.my.cnf
@javierwilson
javierwilson / iptables
Created April 22, 2016 17:59
iptables - router
#
# /etc/sysconfig/iptables
#
# em1 - public IP connected to the Internet
# em2 - private IP, local area network (LAN)
#
# Allow NAT, MASQUERADEing...
*nat
:PREROUTING ACCEPT [0:0]
@javierwilson
javierwilson / bms.sh
Last active September 27, 2016 20:19
bootstrap my shell
#!/bin/bash
dnf -y install vim
dnf -y install zsh
dnf -y install wget
dnf -y install curl
dnf -y install git
dnf -y install bind-utils
dnf -y install whois
dnf -y install util-linux-user
cd ~
@javierwilson
javierwilson / .vimrc
Created February 18, 2016 19:23
vimrc
" enable syntax highlighting
syntax enable
" show line numbers
set number
" set tabs to have 4 spaces
set ts=4
" indent when moving to the next line while writing code
@javierwilson
javierwilson / superglue.py
Created October 5, 2015 21:22
Glues together different lists of dictionaries using a common key
def superglue(data=(), key='id', default=0):
"Glues together different lists of dictionaries using a common key"
alldata = []
for datum in data:
# cast as lists
datum = list(datum)
alldata = alldata + datum
print datum
@javierwilson
javierwilson / pulse.spec
Created November 14, 2014 02:14
spec file for pulse
%define debug_package %{nil}
Name: pulse
Version: 0.10.5
Release: 1%{?dist}
Summary: Open Source Continuous File Synchronization
Group: Applications/Internet
License: GPLv3
URL: https://ind.ie/pulse/
@javierwilson
javierwilson / access_points.cfg
Created June 7, 2014 11:57
Generates and upload Nagios config for Access Points
define hostgroup{
hostgroup_name access_points
alias Access Points
}
{%- for ap in items %}
define host{
use generic-switch
host_name {{ ap.name }}
alias {{ ap.name }}
@javierwilson
javierwilson / sendsms.php
Created May 23, 2014 23:20
Send Bulk SMS using Twilio
<?php
require('Services/Twilio.php');
$sid = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$from = "5555555555";
require('config.php');
#+555555555555,Alice Smith,CT
#+555555555555,Bob Rodriguez,LTO 01A