Archive

Articles taggués ‘Ubuntu’

Clone Your Ubuntu installation

09/03/2024 Comments off

If you want to create a system that is similar to a different system you have already set up, it can be difficult to remember each and every package you had installed.This method works best when you are exporting to and importing from the same distribution and, specifically, the same releasefor example, exporting from Ubuntu Dapper to Ubuntu Dapper or ubuntu edgy to ubuntu edgy.

Ubuntu uses the APT package management system which handles installed packages and their dependencies. If we can get a list of currently installed packages you can very easily duplicate exactly what you have installed now on your new machine. Below is a command you can use to export a list of your installed packages.

sudo dpkg --get-selections | grep '[[:space:]]install$='| awk '{print $1}' > installedpackages
Now you should end up with a file called “installedpackages” which consists of a long list of every package your currently have installed.

The next step would be to tell the clone machine to install each of those packages. You’ll have to copy that file to the clone machine (via network, usb drive, email, etc) and also make sure to duplicate the /etc/apt/sources.list file. Without the same access to repositories it may not be able to find the packages.

To tell your system to use the previously exported package list use the following command (after making sure to also clone your /etc/apt/sources.list file).

Update the source list using the following command

sudo aptitude update

Import the package list using the following command

cat installedpackages | xargs sudo aptitude install

 

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