Skip to content

Instantly share code, notes, and snippets.

View dinigo's full-sized avatar

Daniel Iñigo dinigo

View GitHub Profile
@dinigo
dinigo / afp.conf
Last active August 31, 2023 21:50 — forked from mAAdhaTTah/1_netatalk-3-install-on-ubuntu-14.04.sh
Install netatalk (afp) in Ubuntu with service announcing and provide a Time Machine share. Users must belong to `timemachine` group to be allowed to use it.
[TimeMachine]
path = /store/time-machine
time machine = yes
valid users = @timemachine
@dinigo
dinigo / aria2.conf
Created December 14, 2014 17:56
Aria2c config files and init scripts
# place under ${HOME}/.aria2/
# Daemonize, rpc and session save.
# The daemon is launched by the rpc query and
# stops when all downloads are completed.
continue
daemon=true
on-download-complete=exit
dir=/home/**youruser**/path/to/download/folder
@dinigo
dinigo / smb.conf
Created December 14, 2014 17:47
Samba configuration at /etc/samba/
[global]
workgroup = WORKGROUP
server string = %h server (Samba, Ubuntu)
server role = standalone server
map to guest = Bad User
obey pam restrictions = Yes
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
unix password sync = Yes
@dinigo
dinigo / AmigoInvisible.java
Created December 7, 2014 17:59
Small program to asign partners for "Invisible Friend" events. From a list of names it creates a text file for each containing another one of the list. It ensures no one gets himself asigned.
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Random;
@dinigo
dinigo / install_powerline.sh
Created December 6, 2014 16:25
Install powerline and fonts, and set it for the current user on tmux, vim and bash status line.
#!/bin/bash
sudo apt-get install python-pip git -y
sudo pip install git+git://github.com/Lokaltog/powerline
wget https://github.com/Lokaltog/powerline/raw/develop/font/PowerlineSymbols.otf https://github.com/Lokaltog/powerline/raw/develop/font/10-powerline-symbols.conf
sudo mv PowerlineSymbols.otf /usr/share/fonts/
sudo fc-cache -vf
sudo mv 10-powerline-symbols.conf /etc/fonts/conf.d/
# vim status line
@dinigo
dinigo / faculty.bat
Created November 19, 2014 10:08
A couple of bat scripts for switching between static and DHCP IP configuration on Windows 8
netsh interface ip set address "Wi-Fi" static 10.38.24.24 255.255.0.0 10.38.0.1 1
netsh interface ip set dnsservers "Wi-Fi" static 156.35.41.4 primary
netsh interface ip add dnsservers "Wi-Fi" addr=156.35.14.2 index=2
@dinigo
dinigo / colors.xml
Created June 4, 2014 17:19
Colores de Notecard
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--tarjetas-->
<color name="note_shadow">#ffcfc7b8</color>
<color name="note_dark_shadow">#ffada59a</color>
<color name="note_bg">#fffff7e8</color>
<color name="note_highlight">#ffffffff</color>
<color name="underline">#ffefe8d9</color>
<!--separador -->
<color name="separator">#ffe24c46</color>
@dinigo
dinigo / SelectableArrayListActivity.java
Created May 21, 2014 01:31
ListActivity ready for Context Actionbar multiselect
package es.daniel.notes;
import android.app.ListActivity;
import android.content.Context;
import android.os.Bundle;
import android.view.ActionMode;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
@dinigo
dinigo / context.xml
Last active August 29, 2015 14:01
Patches and config files for a subject
<?xml version='1.0' encoding='utf-8'?>
<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
<Resource name="jdbc/tienda" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="tomcat" password="s3cr3t-hsqldb" driverClassName="org.hsqldb.jdbc.JDBCDriver"
url="jdbc:hsqldb:hsql://localhost:11000/tienda"/>
</Context>
@dinigo
dinigo / customtopo.py
Last active December 31, 2015 11:39
Topology for mininet
'''
La siguiente topologia pretende emular la empleada en la
simulacion del evento en el que se debia realizar el
despliegue de antenas para la covertura. Relativamente parecida
a topologia TreeTopo pero con una implementacion por
completo diferente.
Se dispondra de una cabecera (header) al que se conectaran
un numero (numantenas) de antenas. A cada antena a su vez
se conectara un numero de host especificado por parametro.