Monday, January 6, 2014

Chromium/Iceweasel and qBittorrent magnet links support

Two short steps:

First you'll need to download the chromium/chrome extension Remote Torrent adder.
Go to chrome://extensions and click on the options link of the extension. There chose qBittorrent from the drop-down list, put some username, password and any unused high port like 6883 as suggested.

Now open qBittorrent and go to options (or press alt+O).
There click Web UI option and enable it put the same port, user and password as in the extension and there you have it.

For Iceweasel the proceadure is just in the browser:
Type in the direction bar about:config.
In the search box type handler.expose
Right click, select new, boolean and write  network.protocol-handler.expose.magnet in the preference name field.
Set its value to false, then when you click on the magnet link you will be prompted for the program to open the link with, I chose /usr/bin/qbittorrent

Thursday, June 27, 2013

Wake On Lan (WOL)

Wake on lan is a system which receives a special packet from the network to turn on a machine. Let's begin installing it on the server.

apt-get install wakeonlan

It is prettty easy, first you need to be sure that it is enabled in your bios, since every bios is different, it is your work to find how to do this.

Now the system must have enable WOL as well. Install ethtool on the client

apt-get install ethtool


and run

ethtool eth0

if we see the line

Supports Wake-on: pumbg

WOL is supported by your ethernet card, but for new machines this is alwatys the case. Now if you see the line 

Wake-on: d

WOL is disable. Enable it with

ethtool -s eth0 wol g

Since WOL uses the MAC address to wake a machine you should create the file /etc/ethers with the pair MAC/hostname in the server. Since I have already done something similar for /etc/hosts I used this line to get that done

touch /etc/ethers && for i in $(seq 0 1 12); do arp wn$i | grep | ether | awk '{print $3 " " $1}' >> /etc/ethers

and now for a turned off machine you can run

wakeonlan wn0

Tuesday, December 11, 2012

HP BL460c Gen8 Debian squeeze installation

The issue here is that the hard drive or ethernet drivers are not detected by debian, not even after updating the firmware and the smart array driver as hp suggests here.

First, I must tell that I used a complete install cd, not a netinstall since ethernet is not working.
The solution is pretty simple, you just have to load the module during the installation with an additional option. Before debian installer tries to find the hard drives you switch to another tty and write:

modprobe -r hpsa

to remove the module, then you reaload it with the new option:

# modprobe hpsa hpsa_allow_any=1

Then the system should install as usual, but it'll not load the module automatically when it boots since the rule to load it correctly is not within the system yet.
So, you will have to change some options in the Grub for the system to boot the first time. Go to the edit the line pressing the e key and type at the end of the options line:

hpsa.hpsa_allow_any=1

Press b to boot and the system should boot normally. If you don't want to do this every time you restart the server you must create a file in the folder /etc/modprobe.d/  with the line

options hsa hpsa_allow_any=1

and update the initial ram filesystem with:

# update-initramfs -u

Finally a simple ifconfig will tell you that your ethernet card has been automatically configured, and yout're good to go.
cya.

Friday, April 27, 2012

Ips for NFS and NIS

Some problems this past two weeks arose because the network administrator made me change the server ip for security reasons. It turns out that nfs and nis services went down.

One entire day trying to find the problem and at the end of it y try a simple nmap from a client:

nmap -sTU host_ip

I don't remember the output but just ssh, http,rpcbind, samba, mysql and postgres ports were open.
NFS just needs port 2049/tcp y udp open.
But NIS needs:

111 tcp/udp
681 udp
698 tcp/udp
701 tcp/udp

Ports that weren't opened.
I don't know which is the problem with the firewall tables but no solution other than come back to the old ip was given to me.
So with clients working I can concentrate in security and the monstrous printers to work using smtp.

Wednesday, April 18, 2012

Creating a user

Since we're sharing the file /etc/passwd the user creation is not as simple as typing adduser, but we have to do that (you could also edit /etc/passwd).
Then we go to /etc/passwd and change the last line, where the user is, to look for his home in the nfs shared home folder.

Then the "hard" part:
go to /var/yp/ and type

make

and then reboot nis only on server:

/etc/init.d/nis restart


It's just f*****g hard.

Wednesday, March 21, 2012

NIS

Well, we exported /home for one simple reason, we want to assure every user can access his account on any client, for doing this we have 2 options: NIS or LDAP.
The best option is LDAP but at this moment I don't have time to spare in stuff that I don't really know, so NIS is the choice.

Status of the LAN... a computer is not mounting the nfs... wat?
By mistake I checked /etc/network/interfaces and I found this config:

auto eth0
iface eth0 inet dhcp

The previous sysadmin worked with dynamic ips!, he/she must've been a warlock or something.
 I don't really find useful to work that way so I put them static.

Now, the diagnosis: we have to check the files:
  • /etc/defaultdomain    Same name in server and clients
  • /etc/default/nis    NISSERVER=master and NISCLIENT=false in server, NISSERVER=false and NISCLIENT=true in every client
  • /etc/yp.conf   ypserver 127.0.0.1 in server and ypserver server_ip in clients
  • /etc/nsswitch shared passwd group and shadow in server and client
Everything seemed ok but it wasn't working, so by searching a little around I found that network-manager and nis have some conflicts, I don't know if the problem continues right now because this server is running lenny with a kernel 2.6 (the granpa packages) so I just remove network-manager (I don't need it anyway) and restarted portmap and nis... nope not working.

It turns out that /etc/ypserv.securenets (the file that grants access to clients to the nis server) was with a wrong config, it was giving rights to access to a strange range of ips.

Fixed this, we have nis working :)

Monday, March 19, 2012

NFS

Some introduction for those who doesn't know what this is:
NFS or network file system, is something like dropbox, you share over a network(export) some files from a server and the clients can write on it or read it.

In this particular scenario gfam wanted to export the /home folder so each user in any client can use his info.

Well, first the diagnosis:
nfs was working half-way, some machines were not connecting.
Doing a simple df -h I realized that the file system was not mounting on those machines, It was weird that the file /etc/exports was fine and also /etc/fstab in each client... apparently.

# mount /home

on a client without nfs, prompted me a message saying I don't have permissions from the server, then a

# dmesg | grep nfs

revealed that nfs4 was installed, some config files are somehow different from nfs3.

A bunch of forums and howtos say that in /etc/fstab the type of filesystem has to be specifically nfs4, but that was not necessary.
The real problem was that nfs4 handles the directions from the server in a different way, you have to use correctly the option fsid in the file /etc/exports so the nfs4 pseudofilesystem can export the right folder with the right path, here's a link that will help you (althought it is for arch):