Skip to content

Instantly share code, notes, and snippets.

View iamricard's full-sized avatar
🐕‍🦺

Ricard Solé iamricard

🐕‍🦺
View GitHub Profile
@iamricard
iamricard / mdSenderServer
Created March 9, 2013 14:21
Server version
#!/bin/bash
#SERVER FILE
#Copyright 2013 Ricard Solé
#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
#(at your option) any later version.
@iamricard
iamricard / mdSenderClient
Created March 9, 2013 15:06
Client file
#!/bin/bash
#SERVER FILE
#Copyright 2013 Ricard Solé
#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
#(at your option) any later version.
@iamricard
iamricard / cacl_time.java
Created April 21, 2013 10:19
personal_management
/*
author: @grumpylion
description: does the calculations with the punchcard variable as input
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class funciones {
private static BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
public int how_many_times(String movies_array[][], String rent_array[][]) throws IOException {
String input,
#!/bin/bash
## author @grumpylionking
createuser()
{
echo "desired user name: "
read user
echo "desired group name: "
read group
#!/bin/bash
## author : Ricard Sole Casas
## description : Script that captures input by nfc-list and does what you tell it to do
## twitter : @codinglion
## github : http://github.com/codinglion
## gist : http://gist.github.com/codinglion
while true; do
input=`nfc-list | grep UID | cut -d ":" -f 2 | sed 's/ //g'`
$ sudo apt-get install samba
$ sudo vi /etc/samba/smb.conf
# look for workgroup = WORKGROUP and change WORKGROUP for the workgroup name you set up on Windows
# look for the line #security = user and uncomment it
# save and exit
$ sudo echo -e "[sharedfolder]\n\tpath = /path/to/share/folder\n\tbrowsable = yes\n\tguest ok = no\n\tread only = yes\n\tcreate mask = 0755" >> /etc/samba/smb.conf
$ sudo smbpasswd -a `whoami`
$ sudo restart smbd && sudo restart nmbd
@iamricard
iamricard / main.java
Created May 27, 2013 09:53
examen.java
import java.io.*;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collections;
//author: lion
public class main {
private static String paths[] = {"coches.txt", "Ventas.txt", "vendedores.txt"}; // default files are these, assumed to be in the same directory
// Haz un programa en Java obtenga la fecha actual del sistema y
// a. Permita obtener por separado y lo muestre por consola: el día del mes,
// el día de la semana y la hora (formato 24h). Revisa la documentación
// de las clases java.util.Calendar, java.util.GregorianCalendar para
// llevar a cabo este apartado. Por ejemplo si la fecha actual del
// sistema es Fri Aug 30 16:05:13 CEST 2013, la salida por consola sería
// Día del mes: 30
// Día de la semana: 6
// Hora del día (24Hrs): 16
// b. Permita añadir un mes a la fecha actual y muestre la fecha calculada
// Haz un programa en Java que solicite al usuario 5 títulos de películas y su género (mini base de
// datos de una videoteca). Almacena estos datos en un array multidimensional.
// El programa debe permitir que el usuario pueda realizar una búsqueda por palabras del título y
// por género. Para ello:
// a. Solicita al usuario una palabra de búsqueda del título. Busca en el array las
// coincidencias y muéstralas por consola, indicando título/s completo de la/s película/s
// junto su género.
// b. Solicita al usuario un género. Busca en el array y muestra por consola los títulos de las
// películas que coincidan con el género facilitado
import java.util.Arrays;