Archive

Articles taggués ‘Ubuntu’

Zsync HTTP-based File Transfer Utility Transfers Large Files Efficiently

07/03/2024 Comments off

Zsync is an opensource file transfer utility built on top of rsync algorithm. This helps to download partial/differential files over the HTTP protocol. The utility allows downloading only new parts of a file from a centralized location,  where the older version of the file is already within your computer.

While rsync is for syncing data from one computer to another,  zsync allows file distribution, where the file hosted in a server using any web server can be distributed to many and downloaded seamlessly.

How it works

The command-line utility will do all the differential calculations in the client, instead of doing it in the server as in rsync. Server metadata will be created only once and stored as part of the control file. And rest of the operations and decision making will be handled by the client-side application. This will reduce the huge processing needed on the server-side, even when thousands of clients are trying to fetch the file.

Zsync WorkFlow

Zsync WorkFlow


Server

The server will calculate the checksum and create the control file in advance. This contains checksums,  block size of the file, length and file permissions. Since the rest of the comparisons happens at the client-side, there aren’t any checksum calculations happening on the server, and each time the client requests for data.

Client

The Zsync client is written in “C”, and capable of pulling the metadata from the server first. This will compare with the current files checksum data (generated by rsync) and requests the remaining data from the server. Lire la suite…

Categories: Système Tags: , ,

Set Nemo as Default File Manager in Ubuntu

01/03/2024 Comments off

Nemo is a file manager application developed by Linux Mint team. It is a fork of Nautilus, the GNOME’s file manager. In the beginning, Nemo was just Nautilus 3.4 (Nautilus version which is forked to become Nemo) with different name.

With rapid development and improvement, Nemo now become a full-featured file manager with lots of features, more customizable, and looks beter (in my opinion) than its original (Nautilus).

shutter-2012-12-27-025056

Nemo is the default file manager in Linux Mint, to handle folder and also handle the desktop. You can also easily install Nemo in Ubuntu if you want which is just apt-get away using a PPA (read more: How to install Nemo in Ubuntu),

When you install Nemo in Ubuntu, it doesn’t set itself as the default file manager, Nautilus remains as the default one. If you want to integrate Nemo into Ubuntu system (as the default folder handler), you have to do it manually.

Here I want to share simple command to set Nemo as the default file manager in Ubuntu.

We will invoke the xdg-mime command from freedesktop.org, which is standard command and installed by default in most Linux distribution including Ubuntu. It can be use to set an application (*.desktop file) as the default file opening a certain file type(s) (mime-type). You can also use it to find out what application on your system to handle type(s) of file. Lire la suite…

Categories: Logiciel Tags:

How to enable alt+right click to resize window [duplicate]

29/02/2024 Comments off

Put this in a script and run it:

#!/bin/bash
gconftool-2 -s -t bool /apps/metacity/general/resize_with_right_button true
gsettings set org.gnome.desktop.wm.preferences resize-with-right-button true

The gconftool-2 line is for GConf based systems, and gsettings is its newer replacement.

Categories: Système Tags: ,

Best way to backup all settings, list of installed packages, tweaks, etc?

02/02/2024 Comments off

Programs

 

A quick way of backing up a list of programs is to run this:

dpkg --get-selections > ~/Package.list
sudo cp /etc/apt/sources.list ~/sources.list
sudo apt-key exportall > ~/Repo.keys

 

It will back them up in a format that dpkg can read for after your reinstall, like this:

sudo apt-key add ~/Repo.keys
sudo cp ~/sources.list /etc/apt/sources.list 
sudo apt-get update
sudo apt-get install dselect
sudo dpkg --set-selections < ~/Package.list
sudo apt-get dselect-upgrade -y

 

Settings and Personal Data

 

Before you reinstall, you should probably back up the settings from some of your programs, this can easily be done by grabbing folders from /etc and all the content from your user directory (not just the stuff you can see in nautilus!):

rsync --progress /home/`whoami` /path/to/user/profile/backup/here

 

After you reinstall, you can restore it with:

rsync --progress /path/to/user/profile/backup/here /home/`whoami`

 

So all together as a pseudo-bash script.

 

This assumes there is only one user on the machine (remove /'whoami' otherwise) and that you used the same username on both installs (modify dest. of rsync otherwise).

dpkg --get-selections > ~/Package.list
sudo cp /etc/apt/sources.list ~/sources.list
sudo apt-key exportall > ~/Repo.keys
rsync --progress /home/`whoami` /path/to/user/profile/backup/here

##  Reinstall now

rsync --progress /path/to/user/profile/backup/here /home/`whoami`
sudo apt-key add ~/Repo.keys
sudo cp ~/sources.list /etc/apt/sources.list 
sudo apt-get update
sudo apt-get install dselect
sudo dpkg --set-selections < ~/Package.list
sudo dselect

 

Fixing Apache after Ubuntu 13.10 upgrade

01/02/2024 Comments off

Ubuntu 13.10 was released yesterday. As well as other package updates, it includes an upgrade from Apache 2.2 to 2.4, which broke a few things on my dev machine.

After the upgrade I was getting the standard « It works! » Apache message on all of my virtual hosts. Running apache2ctl configtest gave me the familiar warning:

Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message

You often get this error in an out-of-the-box Ubuntu setup as you need to tell Apache what hostname to use as the default. I’d previously fixed this by creating a config file at /etc/apache2/conf.d/fqdn that contains only:

ServerName localhost

so first I had to investigate why this was no longer working. It turned that Apache 2.4 no longer reads configs from conf.d. If you check the end of apache2.conf, you’ll see that it now looks in a folder called conf-enabled instead:

# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf

This folder contains symlinked files pointing at conf-available, making the conf setup similar to the approach used for vhosts. So, to fix the error I moved all of my configuration files from conf.d to /etc/apache2/conf-available/, added a .conf file extension to each one, and then ran:

a2enconf fqdn

to setup the symlink.

After restarting Apache, the FQDN error was gone, but I was still getting the « It works! » message for all my vhosts. I had another look at the main Apache config and found:

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

So by default Apache expects the vhost files to have a .conf file extension (which it didn’t before). Mine just used the hostname as the filename. So I renamed each of these and updated the symlinks that point to them.

After that everything was back to normal.

A full 2.2 to 2.4 upgrade guide is available in case you have any other issues. Of particular note is the change to the syntax for ‘Deny from’ and ‘Require’, so if you start getting « 403 Forbidden » errors on things that previously worked you’ll probably need to update those directives.

Many/all of these issues could be mitigaged by either keeping old configs during the upgrade or by installing the provided compatibility module, but in development I prefer to always install package maintainer’s configs when upgrading so that I know how to fix things if they were to go wrong in production.

Categories: Logiciel, Système Tags: , ,