Linux installation data

Sometimes, it could be useful to remember the data of installation of your Linux system, even just to be proud of the long years of life of your Linux distribution without big problems.

A simple way to know that date is with the command:

$ sudo dumpe2fs /dev/sda1 | grep 'Filesystem created'

that shows the date of creation of filesystem, in the indicated partition.

If you are not sure about your the root partition, check it using the disk free command:

$ df -h

the root partition is the one mounted on “/“.

Enjoy! ;-)

2015 in review

The WordPress.com stats helper monkeys prepared a 2015 annual report for this blog.

Here’s an excerpt:

A San Francisco cable car holds 60 people. This blog was viewed about 3,600 times in 2015. If it were a cable car, it would take about 60 trips to carry that many people.

Click here to see the complete report.

Torrentflux

Torrentflux is a very useful web-application to download torrent on Linux, based on php and Apache webserver.

Pratically, the only interface of this program is a website where the user can easily manage the torrent downloads. It’s very useful because it runs in background without use the GUI and the influence on the system is low. Moreover, the web interface permits to enable the access to the Torrentflux by remote, just setting the right ports forwarding on the home router and using the public IP assigned by the ISP provider on the home connection.

This program runs on apache (PHP webserver) and use the mysql engine.
So, for a debian-based linux the installation steps are:


$ sudo apt-get install mysql-client mysql-server mysql-common

and follow the required database configuration (mainly are required passwords for the database users).


$ sudo apt-get install php5 php5-mysql
$ sudo apt-get install apache2

and then the last step

$ sudo apt-get install torrentflux

After these steps, the Apache2 service need to be restarted

$ sudo service apache2 restart

and the link to the application checked under /var/www/html/.
If is not present, it is necessary to create the link to torrentflux on the webserver

$ sudo ln -s /usr/share/torrentflux/www/ /var/www/html/torrentflux

Finally, the Torrentflux web interface should be running at address
http://localhost/torrentflux/
or
http://127.0.0.1/torrentflux/

Have good downloads!
:-D

install Pyload on NAS Synology – DSM 5.1

Two months ago I bought a new Network Attached Storage.
For my purposes, I choose a NAS Synology DS213J with two hd Western Digital RED of 3TB for each, to have 3TB of free space with a best RAID1 “bit-to-bit” backup.

So this special NAS, has a custom Linux OS with a wonderful web GUI to manage every part and to use various applications created for it, like a Download Manager, a Video Streamer, a Cloud Station and so on. Using Linux and having so many applications (made by the producer or by the community of users) I hoped to find a version of Pyload made for it. But I was wrong, because there is a Pyload made for Synology, but it is for older version of Synology OS: on my OS, DSM version 5.1, it doesn’t work.

So, in this forum I found a working solution.

 

Following, the steps:

 

1- For first you need to install the official app of “Synology Pyload” developed by the pyload Team.
This app is a 3rd party community package, that means that is developed by the community and not directly from Synology. So, to have this app into the installation list on your DSM 5.1 operating system you need to open the DSM Package Center, click on the Settings tab, then on the item Package Sources, Add button and insert the url http://spk.unzureichende.info/. Now, you can find the Pyload app into the Community item, into the Package Center, and then try to install it on the DSM 5.1. On the DSM 5.1 the installation process fails, but it necessary to do this before the next steps.

 

2- The second step is to do the standard setup by command-line of Pyload, as on a normal linux machine.
So, for this you must connect on remote terminal to your NAS through ssh, using the root user (pay attention!), that has the same password of the admin user (is the same user, but for the terminal is needed the username root to have correct administration priviledges). After the ssh connection, you should have a particular terminal like this:

DiskStation>

To have a normal sh terminal, type the command su and then you’ll get the root terminal on your Synology NAS.
Then, the linux command to correct install Pyload on your DSM 5.1 is:

# /volume1/@appstore/pyload/bin/python /volume1/@appstore/pyload/pyload/pyLoadCore.py -s

ATTENTION: to run Pyload and its setup process you need to have PYTHON installed. I installed both the app “Python3” and the “Python Module” found into the producer’s app list

After that command, you must have to insert all the Pyload configurations, like the Port of the NAS on which start the Pyload daemon (to connect to Pyload via browser), the SSL security connection settings and so on.

Then, you can try to start Pyload using

# /volume1/@appstore/pyload/bin/python /volume1/@appstore/pyload/pyload/pyLoadCore.py

and verify it connecting via browser to the IP of the NAS at the daemon port specified. Mine is at:

http://192.168.1.3:8080

 

3- Configuration of the Pyload user.
Pyload needs a special configuration command to add a Pyload user (even if is the first or the only user), done with the command:

# /volume1/@appstore/pyload/bin/python /volume1/@appstore/pyload/pyload/pyLoadCore.py -u

 

4- Automate the startup of Pyload
To automate the startup of Pyload at the startup of the machine, you need to create the new script file:

# touch /usr/syno/etc/rc.d/S99pyload.sh

and write into that file this script:

#!/bin/sh
COMMAND="/volume1/@appstore/pyload/bin/python /volume1/@appstore/pyload/pyload/pyLoadCore.py"

start() {
        echo "Starting PyLoad"
        $COMMAND --daemon
}

status() {
        echo -n "Status of PyLoad: "
        STATUS=$($COMMAND --status)
        if [[ $STATUS = "False" ]]; then
                echo "Not running"
        else
                echo "Running as PID $STATUS"
        fi
}

stop() {
        echo "Stopping PyLoad"
        $COMMAND --quit
}

case "$1" in
        start)
                start
                ;;
        stop)
                stop
                ;;
        restart)
                stop
                sleep 4
                start
                ;;
        status)
                status
                ;;
        *)
                echo "Usage: $0 (start|stop|restart|status)"
                exit 1
                ;;
esac
exit 0

Then this file need the execution priviledges

# chmod +x /usr/syno/etc/rc.d/S99pyload.sh

and on the next system startup Pyload will be launched automatically!
To start now pyload, the command is:

# /usr/syno/etc/rc.d/S99pyload.sh start

 

VERY INTERESTING: after this setup, Pyload can be used also by the Synology app, that opens a window with the same web GUI in execution at the port specified!!

 

Enjoy! ;-)

set-up proxy on linux

Hi everyone!

Here a simple guide to set up a connection via proxy.
If you need to use a proxy to connect to any remote host, you can configure your linux system to use it automatically.
In case of an http proxy, you must write the line below into /etc/environment:

export http_proxy="http://<user>:<pwd>@<host>:<port>"

where “user” is your proxy user, “pwd” is your proxy password, “host” and “port” are the proxy IP and PORT defined to use that proxy connection.

If you need to set other proxy types, you can use the following options:
https_proxy=…,
ftp_proxy=..,
socks_proxy=..
or all_proxy=.. if you use the same proxy options on all proxy servers.

Enjoy! ;-)

remote Xfce4 desktop on ArchLinux

Hi everybody!

Few weeks ago I installed Arch linux on my RaspberryPI, to try this particular distro. ArchLinux is a “nerd” distro of Linux, where you must setup every single part that you need to use.
(You can find instructions to setup ArchLinux on Raspberry here)

In this post I don’t want to explain the setup of every single parts into ArchLinux, because there are already many guides for that (best guide is https://wiki.archlinux.org/), but I want to talk about a particular situation like mine, where there is a Raspberry PI without monitor and keyboard, with only the ethernet cable to talk with any user, and the need to use the GUI of the Raspberry.
So the question is how get remote Xfce4 desktop on ArchLinux through SSH terminal?.

For first, you need to connect to your remote SSH terminal and install Xorg and Xfce4 on the machine. You also need to install vncserver provided by the package tigervnc.

After that, you only need to create the file ~/.vnc/xstartup (if already exists, delete it and create a new file), and into that file you must write:

#!/bin/sh
exec /bin/sh /etc/xdg/xfce4/xinitrc

that starts an Xfce4 session at every VNC connection of the user owner of that home sub-folder.

The last operation to do is to start on the remote machine a vnc remote desktop, using the command

$ vncserver

that print the number ID of the new remote desktop created.
Then, you can connect to that remote desktop using a simple VNC program, like xvnc4viewer or the graphical remote desktop client remmina of Ubuntu, using as remote IP the format <remoteIP>:<dekstopID> like this:

192.168.1.3:2

or, otherwise if you need to setup the connection PORT, you only have to sum the standard VNC port 5900 to the ID of the desktop (if the new desktop created is the number 2 the remote port will be 5902).

Enjoy! ;-)

 

PS: to delete the created remote dekstop (for example the desktop 2), the command is

$ vncserver -kill :2

APT proxy connection

In some cases I needed to connect to internet through a proxy.
There are many ways to set the proxy data into browsers or other applications, and sometimes the APT needs an own proxy configuration.

If your APT does not connects to internet and you must use a proxy, you need to execute this command:

# echo "Acquire::http::proxy \"http://username:pwd@proxyIP:port\";" >> /etc/apt/apt.conf

where username and pwd are your username and password used to login into proxy server, proxyIP and port are the IP address and port of your proxy server.

If the file /etc/apt/apt.conf is not already present into system, this command creates the file and writes into it.
If the file is already present, it can have a standard line for proxy settings, that you have to modify with your settings or to delete after the execution of the command.

After that, you can test the connection of APT with:

# apt-get update

and you should have a normal update of the repositories.

Enjoy! ;)

Follow

Get every new post delivered to your Inbox.

Join 60 other followers