Archive for the ‘General’ category

Install BackupPC on Centos 6.3

February 13th, 2013

BackupPC logo

Backups are important, every hard disk, every motherboard, every piece of hardware will fail.  Remember this if you don’t have a backup system.

Step 1. Install required software

enable epel repo

yum install wget

wget http://ftp.rediris.es/mirror/fedora-epel/6/i386/epel-release-6-7.noarch.rpm
rpm -i epel-release-6-7.noarch.rpm

yum install BackupPC

Step 2:enable Apache webserver

edit apache config file

vi /etc/httpd/conf/httpd.conf

and make apache run as backuppc user

User backuppc

edit BackupPC apache config

vi /etc/httpd/conf.d/BackupPC.conf

should be like these

<IfModule !mod_authz_core.c>
# Apache 2.2
order deny,allow
allow from all
allow from 127.0.0.1
allow from ::1
require valid-user
</IfModule>

chkconfig httpd on

/etc/init.d/httpd start

Step 3: Configure Backuppc password

htpasswd -c /etc/BackupPC/apache.users backuppc

Step 4: Enable BackupPC Service

chkconfig backuppc on

/etc/init.d/backuppc start

Step 5: Verify installation

open a browser and navigate to

http://<Backupchost>/backuppc

Clean backup pc install

sudo and /etc/sudoers.d directory

January 4th, 2013

sudo logo

I needed to add a new user into sudoers file into several debian machines, i didn’t want open a terminal in each machine and add the line manually, the other option was append a new line into the file like echo “new line”>> /etc/sudoers .But I don’t like edit sudoers file without using visudo, I don’t feel safe.

Reading the debian documentation I found a magical directive for append external files #includedir /etc/sudoers.d, that’s mean if I add a new file  with 0440 permisions and the permissions are important will be appended into our sudo config.

Removing the hash character is a inherited custom ok don’t remove the hash character  is not a comment indicador withouth the hash character, includedir /etc/sudoers.d is a bad line and visudo show an error.

Migrating from M0n0wall to pfSense

December 1st, 2012

During the last year,  talking with some colleages about firewalls and operative systems the mayor part of then said that they’re using, Pfsense instead M0n0wall. Recently I get a new job and my home networks are in the same range that the work network and some clients. To avoid this situation I decided migrate my router from M0n0wall to Pfsense and thats are the steps:

I decided maintain a copy of the actual M0n0wall config, bougth a new compact flash was the quick option.

Download pfSense

First I downloaded the version for my router, in this case it’s and ALIX Board without VGA,, that means that i need to choose the nanobsd version and my compactFlash size is 4Gb, if I had a bigger campactFlash I just only need to take the 4gb versión.

wget http://files.nl.pfsense.org/mirror/downloads/pfSense-2.0.1-RELEASE-4g-i386-nanobsd.img.gz
wget http://files.nl.pfsense.org/mirror/downloads/pfSense-2.0.1-RELEASE-4g-i386-nanobsd.img.gz.md5

wget http://files.nl.pfsense.org/mirror/downloads/pfSense-2.0.1-RELEASE-4g-i386-nanobsd.img.gz.sha256

Verify downloaded image:

md5sum pfSense-2.0.1-RELEASE-4g-i386-nanobsd.img.gz

and check if output it’s the same that content in /pfSense-2.0.1-RELEASE-4g-i386-nanobsd.img.gz.md5

sha256sum pfSense-2.0.1-RELEASE-4g-i386-nanobsd.img.gz

and check if output it’s the same that content in /pfSense-2.0.1-RELEASE-4g-i386-nanobsd.img.gz.sha256

Dump pfSense into the compact flash

In my case as fedora user i need to detect what device file is linked to my compactFlash i make this

open a root cosole and write

mount >mountedBefore

this generate a file with actual mounted files

i attach the compact flash and execute

mount >mountedAfter

now i write

diff mountedBefore mountedAfter

and the output will be like:

> /dev/sdd1 on /run/media/luzem/753C-3741 type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=cp437,iocharset=ascii,shortname=mixed,showexec,utf8,errors=remount-ro,uhelper=udisks2)

It said that my compact flash is on /dev/sdd file

first i need to umount it

umount /dev/sdd1

now i decompress and dump pfSense into compact flash writing

zcat pfSense-2.0.1-RELEASE-4g-i386-nanobsd.img.gz | dd of=/dev/sdd bs=16k

you should get and output like these

244138+1 records in
244138+1 records out
3999969792 bytes (4.0 GB) copied, 226.826 s, 17.6 MB/s

Putting pfSense into alix board

Now plug the compactFlash on your board

connect your board , power, ethernet ….

enjoy reconfiguring yout new router

alix 2d3

Setting up a Php Continuous integration environment in Centos 6

July 31st, 2012

As part of my job I need to create a continuous integration environment for my develops in Php.

first I installed Gitlab and then I installed Jenkins using the web page tutorial ( http://jenkins-ci.org/ ).

you need to have enabled EPEL repos http://fedoraproject.org/wiki/EPEL and rpm Fusion repos http://rpmfusion.org/ .

when you have Jenkins installed you will need install the needed packages open a root terminal and write:

yum install ant php php-phpunit-phploc php-pdepend-PHP-Depend.noarch php-phpmd-PHP-PMD.noarch php-phpunit-phpcpd.noarch php-phpunit-phploc.noarch php-pear-PHP-CodeSniffer.noarch php-phpunit-PHP-CodeBrowser.noarch

The next step is add the php template into Jenkins CI

  • cd /var/lib/jenkins/jobs
  • mkdir php-template
  • cd php-template
  • wget https://raw.github.com/sebastianbergmann/php-jenkins-template/master/config.xml
  • cd ..
  • chown -R jenkins:jenkins php-template/
  • /etc/init.d/jenkins restart

now we can create a new php project based on the php-template :-)

Jenkins git ssh auth in Centos 6

April 21st, 2012

jenkins

After install Gitlab the next step  was install Jenkins and start to work with a continuous integration server. I installed Jenkins following doc and create a new project for one of my repos. and i get this output

Building in workspace /var/lib/jenkins/jobs/PFC/workspace
Checkout:workspace / /var/lib/jenkins/jobs/PFC/workspace – hudson.remoting.LocalChannel@1aba936a
Using strategy: Default
Cloning the remote Git repository
Cloning repository origin
ERROR: Error cloning remote repo ‘origin’ : Could not clone gitolite@git.luzem.com:pfc.git
hudson.plugins.git.GitException: Could not clone gitolite@git.luzem.com:pfc.git
at hudson.plugins.git.GitAPI.clone(GitAPI.java:245)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1117)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1059)
at hudson.FilePath.act(FilePath.java:832)
at hudson.FilePath.act(FilePath.java:814)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1059)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1218)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:581)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:470)
at hudson.model.Run.run(Run.java:1421)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:238)
Caused by: hudson.plugins.git.GitException: Command “git clone –progress -o origin gitolite@git.luzem.com:pfc.git /var/lib/jenkins/jobs/PFC/workspace” returned status code 128:
stdout: Initialized empty Git repository in /var/lib/jenkins/jobs/PFC/workspace/.git/

stderr: Host key verification failed.
fatal: The remote end hung up unexpectedly

at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:779)
at hudson.plugins.git.GitAPI.access$000(GitAPI.java:38)
at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:241)
at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:221)
at hudson.FilePath.act(FilePath.java:832)
at hudson.FilePath.act(FilePath.java:814)
at hudson.plugins.git.GitAPI.clone(GitAPI.java:221)
… 12 more
Trying next repository
ERROR: Could not clone repository
FATAL: Could not clone
hudson.plugins.git.GitException: Could not clone
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1129)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1059)
at hudson.FilePath.act(FilePath.java:832)
at hudson.FilePath.act(FilePath.java:814)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1059)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1218)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:581)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:470)
at hudson.model.Run.run(Run.java:1421)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:238)

When you install Jenkins from the repos one problem is configure ssh keys for jenkins user, the first thing to configure ssh keys was su jenkins and run ssh keygen but it failed because i can’t log with Jenkins user.

i open a terminal as root on server machine as root and start writing:

vim /etc/passwd

changing jenkins line

jenkins:x:492:486:Jenkins Continuous Build server:/var/lib/jenkins:/bin/false

for

jenkins:x:492:486:Jenkins Continuous Build server:/var/lib/jenkins:/bin/bash

after changuing this line you can do

su jenkins

cd

ssh-keygen

cat .ssh/id_rsa.pub

now you have the key for your jenkins user and it can pull from your repos

for more security edit again /etc/passwd and pul false in jenkins shell

jenkins:x:492:486:Jenkins Continuous Build server:/var/lib/jenkins:/bin/false

Installing OpenWRT Backfire in a fonera 2100

March 3rd, 2012

Sometimes pocket money isn’t enought for buy new network devices or we want to save some money changuing no existant money for personal time. In my case I needed to create a wireless bridge in my personal network, pass a ethernet wire between two builds wasn’t an option. Searching in my forgoten stuff boxes i found two foneras model 2100. Fon’s firmware isn’t powerfull enought to get wds and when these things happens Free Software is our solution. A couple of foneras Ready for flashing I’m a lucky man and I also found a usb to 3,3V serial adapter, one of my superpower is that i can brick everything. First of all we need to plug our serial adapter into fonera’s port, check the attached image for see jtag pinouts Fonera pinouts

when we have our jtag port connected we need a software for send data over jtag in my case i use GtkTerm.

in debian is simply I open a root terminal and I write

apt-get install GtkTerm

in the same term i write

gtkterm

I use a root terminal because I don’t want waste time configuring /dev/ttSy* permissions

next step is configure port speed 9600,8N1

in GtkTerm menu select configuration/port and fill data boxes, in my case port is /dev/ttyUSB0 if you don’t know your port a dmesg output can be helpul.

GtkTerm 9600,8N1

now is time to plug powersounce on our fonera and see output.

must be something like this in our gtkterm

Fonera booting

we need get access to redboot console  you only need un plug and plug powersource to fonera and press continously ctrl+c until you see

RedBoot>

we need download ou firmware go to

http://downloads.openwrt.org/backfire/10.03.1/atheros/

and download these files

  • openwrt-atheros-vmlinux.lzma
  • openwrt-atheros-root.squashfs
save the files and then we need install tftp server in our machine.

search ftpd config for your distro

Next step will be load files into fonera over tftpd config
in gtkterm we need write
ip_address -h <TFTP SERVER IP ADRESS> -l <ONE FREE IP IN YOUR NETWORK>/24
load -r -b %{FREEMEMLO} openwrt-atheros-vmlinux.lzma
fis init
fis create -e 0×80041000 -r 0×80041000 vmlinux.bin.l7
load -r -b %{FREEMEMLO} openwrt-atheros-root.squashfs
fis create rootfs
reset
if your system doesn’t boot because you have installed dd-wrt before or something similar write this in redboot console:
 fconfig boot_script_data
fis load -l vmlinux.bin.l7
exec
“press enter”
reset
enjoy
sources:

Wikileaks

December 3rd, 2010

Como ver el video de PESI sin estar todo el dia esperando por el streaming

October 25th, 2010

El video de la practica 1 se puede ver desde la pagina de uvigo.tv pero claro si tenéis internet a pedales como yo pues se transforma en una pequeña tortura china.

Así que lo mejor seria tener el video guardado en el disco duro y poder verlo sin sufrir los cortes de buffer, las desconexiones etc etc. Para hacer esto unas vueltas por google y la solución esta en instalar mimms desde los repositorios de tu distribución favorita.

una vez instalado abrimos una terminal y escribimos este comando y en un ratito tendras la presentación en tu disco duro.

mimms mms://videoserver.uvigo.es/VoD/ptg/10-antonio_gomez_soto.wmv

enjoy

¿Quien me ha visitado durante esta año?

September 6th, 2010

Tras un añito desde que me puse a poner examenes y apuntes miras un listado de visitas y se te cara de tonto al ver desde donde te entran las visitas

universidad de vigo (esto era fijo)
administracion nacional de telecomunicaciones
red informatica cientifica de andalucia
universidade da coru~na (yo queria estudiar aqui)
gobiernocanarias
indiana university-purdue university at indianapolis
tu darmstadt hochschulrechenzentrum
universidad de la laguna
secretaria de educacion e investigacion tecnologic
universidad nacional autonoma de mexico
red academica y de informacion nicaraguense
santiago de compostela
universidad tecnica federico santa maria
opera software asa (no me importaria trabajar aqui)
petroleos mexicanos
universidad de inform tica
universidad de murcia
universitat politecnica de catalunya
universitat politecnica de valencia
university of southern california (quería hacer el curso puente en Santiago para poner titulado por la USC )
instituto tecnologico y de estudios superiores de
pontificia univ. catolica del peru
universidad autonoma de colima
universidad autonoma de nuevo leon
universidad de guadalajara
universidad de santiago de compostela
direccion general de trafico
instituto tecnologico de hermosillo
sociedad andaluza para el desarrollo
true the real unix experts
universidad autonoma de la laguna
universidad autonoma del estado de mexico
universidad carlos iii de madrid
universidad de alicante
universidad de chile
universidad nacional de rio cuarto
universidad politecnica de madrid
universitat ramon llull
university of bio-bio
benemerita universidad autonoma de puebla
centro de investigacion y de estudios avanzados de
concordia university
educacion profesional atenea s.a.
escuela politecnica nacional
escuela superior politecnica del litoral
fundaci n centro nacional de innovaci n tecnol gica (cenit)
grupo prisa
hewlett-packard company (no me molestaria trabajar aqui)
instituto costarricense de electricidad y telecom.
instituto de desarrollo empresarial de america latina s.a.
instituto de investigaciones electricas.
instituto nacional de aprendizaje (ina)
instituto nacional de astrofisica optica y electronica
instituto tecnol gico y de estudios superiores de monterrey
intervencion general de la administracion del estado
junta de castilla y leon external links
junta de extremadura
mapfre servicios de informatica s.a.
laboratorios labein
mercabarna
ministerio de agricultura
ministerio de cultura
mondragon eskola politeknikoa s. coop.
oficina de estudios y politicas agrarias
oracle datenbanksysteme gmbh (tampoco me molestaria trabajar aqui)
philips forschungslaboratorien aachen
poder judicial prov. de salta
pontificia universidad catolica del ecuador
princeton university
red de supercomputacion de galicia
servizo galego de saude-conselleria de sanidade
sociedad de inversiones matriz s.a.
texas instruments
universidad autonoma de ciudad juarez
universidad autonoma de madrid
universidad complutense de madrid
universidad de antioquia
universidad de cantabria
universidad de castilla – la mancha
universidad de cuenca
universidad de extremadura
universidad de guanajuato
universidad de la rioja
universidad de pamplona
universidad de quintana roo
universidad de salta
universidad de valladolid
universidad de zaragoza
universidad diego portales
universidad icesi
universidad industrial de santander – uis
universidad juarez autonoma de tabasco
universidad laica eloy alfaro de manabi
universidad mayor
universidad minuto de dios
universidad nacional de colombia
universidad nacional del nordeste
universidad rey juan carlos
universidad tecnologica centroamericana
universidad tecnologica nacional
universidad verecruzana
universitat d andorra (isp in andorra)
universitat de girona
university of las palmas de gran canaria
university of strathclyde
zara france (oh my good from Arteixo to paris)
apple inc. (da nivel tener visitas de aqui)