Looking for the right archive format with deduplication

I’m often copying my files to an external disk as a backup option. So far, nothing fancy.

However, I end up with many copies of more or less the same folders over time. And that takes a lot of space for nothing.

Incremental backups, that only add new files to an archive, might look as a solution for that, but over time the paths changes, the structure changes. So the deduplication would break.

One solution could be to format my disk with a system such as ZFS or BTRFS which have a deduplication built-in. However I can’t use my disk for quick operations/archiving on Windows, nor on Mac (easily at least).

So I want an archive format with:

  • Deduplication
  • Some compression (lot of source code files)

One might think, and I often came across that statement while searching on the web for a solution, that one shouldn’t worry about that as compression algorithm inheritely support deduplication. That is actually wrong, they’re not made to merge very large patterns. The following experiment shows it with file of random data (incompressible) :

-rwxrwxrwx 1 tbarbette tbarbette 10M Apr 17 21:09 binA
-rwxrwxrwx 1 tbarbette tbarbette 10M Apr 17 21:10 binACOPY
-rwxrwxrwx 1 tbarbette tbarbette 10M Apr 17 21:09 binB
-rwxrwxrwx 1 tbarbette tbarbette 256M Apr 17 21:19 binBIG
-rwxrwxrwx 1 tbarbette tbarbette 256M Apr 17 21:19 binBIGCOPY
-rwxrwxrwx 1 tbarbette tbarbette 10M Apr 17 21:09 binC

Here’s the size for a few formats :

tar.gz553M19.48star -cpazf [archive] [file]
tar.xz553M303star -cpaJf [archive] [file]
zpaq287M18.7szpaq add [archive] [file]
wim287M4.4s7zz a [archive].wim [file]
.7z543M37s7zz a [archive].7z [file]
.7z (512M dictionnary)287M140s7zz a [archive].7z -m0=LZMA2:d512m [file]
.7z (1513M dictionnary)287M114s7zz a [archive].7z -m0=LZMA2:d1513m [file]

zpaq is the clear winner considering it can also compress at the same time, however it’s not very widespread, and has no good GUI available. I’m wondering about recovery in case of problems.

wim has no compression, so it will need to be encapsulated in something else. The problem is then to add some files. I have to uncompress the inner wim format first. The idea being to save the same computer again and again, one of those archives is 200G, so it means adding a single file would take a huge time. While zpaq can add one quite fast.

7zip with a dictionary large enough to hold big duplicates would seem to be a good compromise.

Any input?

Leaving ownCloud for good

ownCloud was kind of abandonned after the fork to nextcloud. I wanted to stay true to my historic “own” cloud provider. But the lack of support for PHP 8.1 now that 7.X is EOL killed it for good.

Two messages for anyone that comes here through random search :

  • There is no way to migrate automatically to nextcloud anymore. Chances are you updated beyond ownCloud 10.5, and there’s no downgrade possible. So don’t try.
  • Long life nextCloud! I didn’t realise the many things I was missing with ownCloud… NextCloud has million more features. So leave ownCloud now and go to nextCloud.

Limit rate of mail sent by motion detection daemon (motiond) for webcam surveillance

Maybe you use the “on_picture_save” to send yourself an e-mail with motiond when your webcam detect an  intruder. But when someone enters, you’ll receive a lot of pictures. And if it was just you forgetting to stop the detection before entering, your smartphone will become a christmas tree for nothing…

I just published my last program “limitrate” on Github :


This programs allows you to limit the rate of launching a certain command. Instead of launching

/usr/bin/program argument1 argument2

call :

limitrate 30 “/usr/bin/program % argument2” argument1

To launch only this command at maximum once every 30 seconds. If you call multiple times the last line in 30 seconds, limitrate will run the command only after 30 seconds replacing the “%” by the concatenation of all “argument 1”. For example to send an alert e-mail containing files (for example webcam picture) at max every 30 seconds :

10:24:30 : limitrate 30 "echo \"Alert!\" | mailx % destination@mail.com" "-A /path/to/file1"
--> Send a mail with file1
10:24:32 : limitrate 30 "echo \"Alert!\" | mailx % destination@mail.com" "-A /path/to/file2"
10:24:38 : limitrate 30 "echo \"Alert!\" | mailx % destination@mail.com" "-A /path/to/file3"
10:24:41 : limitrate 30 "echo \"Alert!\" | mailx % destination@mail.com" "-A /path/to/file4"
10:25:05 : limitrate 30 "echo \"Alert!\" | mailx % destination@mail.com" "-A /path/to/file5"
--> Send a mail with file 2,3,4 and 5

Example configuration for motion detection daemon (Camera surveillance) :

on_picture_save /usr/local/bin/limitrate 15 “echo \”See attachment below.\” | mailx -s ‘Motion in the saloon !’ %destination@tombarbette.be” “-A %f”

When an intrusion is detected, you’ll receive a first e-mail with one image. 15 seconds later you’ll receive all the new images in only one mail, and so on.

Installing Spotify 9.10 (may 20), 9.11 (july 2) on fedora 20 64 bits

UPDATE : Tested for 9.11 on July 2


Remove any old version of spotify :

yum remove “*spotify*”

rm -rf /usr/local/share/spotify*


Remove any configuration file of the last spotify version :

rm -rf /home/$USER/.config/spotify

rm -rf /home/$USER/.cache/spotify


Download the debian package at http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_0.9.10.17.g4129e1c.78-1_amd64.deb  http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_0.9.11.26.g995ec04.78-1_amd64.deb:

wget http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_0.9.11.26.g995ec04.78-1_amd64.deb


Install alien to convert the deb to RPM :

sudo yum install alien


Convert the deb to RPM with alien :

fakeroot alien -r spotify-client_0.9.10.17.g4129e1c.78-1_amd64.deb


Install the rpm :

sudo rpm -ivh –nodeps –force spotify-client-


You will very probably have problems of dependencies to old libraries when launching spotify, like for libssl.so.1.0.0 , libudev.so.0 and libcrypto.so.1.0.0, I made a tarball with them.


Download oldlibs.tar :

wget https://www.tombarbette.be/wp-content/uploads/2014/05/oldlibs.tar.gz


Untar them :

tar -zxvf oldlibs.tar.gz


Copy them to /usr/lib64 :

cp -rf oldlibs/* /usr/lib64/


Remove the tarball :

rm -rf oldlibs*


If you don’t have any shorcut to launch spotify, copy the desktop entry :

cp -rf /opt/spotify/spotify-client/spotify.desktop /usr/share/applications/


If when you type “spotify” it doesn’t launch anything (and say this command is not found) :

sudo ln -s /opt/spotify/spotify-client/spotify /usr/bin/spotify

SourceForts Console commands

SourceForts is really a great mod for Half-Life 2 multiplayer, featuring a construction phase with blocks and panels before a combat phase. But the wiki has died a long time ago, and I decided to copy a save of the console commands here, as it’s not findable anymore.

Common Commands

Phase Limits

  • addtime [integer] Adds time (in seconds) to the current phase (can remove time too if integer is negative)
  • sf_build_long_length Length of the long Build Phase in seconds. Default 600
  • sf_build_short_length Length of the short build phase in seconds. Default 240
  • sf_combat_length Length of Combat Phase in seconds. Default 600
  • togglephase Changes the phase (either from build to fight or vice versa)

Match Limits

  • sf_roundlimit Number of rounds (cycles of Build / Combat) a map is played for. Default 4
  • sf_scorelimit [integer] Amount of points for a team to win the game. Default 1000
  • map_restart cmd – Completely restarts game, all scores returned to zero and all blocks removed.

Team Limits

  • sf_forcebalance Default : 1 – Force team balancing on connect. While on, you can only join the team with the least players.
  • sf_team_blocklimit [integer] Sets the blocklimit for both teams
  • sf_team_autoassign [0/1] Setting of 1 forces joining players to join smallest team


  • sf_block_damage_multiplier Default : 3 – Multiplier of damage dealt to blocks by weapons. Higher number = blocks are easier to destroy.
  • sf_block_extra_force Default : 10 – Physics damage multiplier if hit by a block in combat.
  • sf_block_health Default : 6000 – Block damage health
  • sf_block_unfreeze_health Default : 1250 – Block unfreeze health, basically sets the time it takes to unfreeze a block.
  • sf_combat_freeze_friendly Default : 6 – Time in seconds to freeze a friendly block
  • sf_combat_unfreeze_enemy Default : 12 – Time in seconds to unfreeze an enemy block
  • sf_combat_unfreeze_friendly Default : 4 – Time in seconds to unfreeze a friendly block.
  • sf_freeze_continue_distance_combat Default : 16 – How far, in units, you have to be from a block to freeze it.
  • sf_freeze_continue_player_move_distance_combat Default : 16 – How far, in units, you can move from a block while freezing it without stopping.
  • sf_freeze_distance_build Default : 600 – How far, in units, you can freeze/unfreeze blocks in build phase
  • sf_freeze_starting_distance_combat Default : 128
  • sf_repair_delay Default : 0 – How long, after holding fire, it takes for you to start repairing a block (obsolete)
  • sf_repair_distance Default : 96 – How far you can be from a block to repair it.
  • sf_repair_increment Default : 45 – How many HP you return to a block while repairing

Class Settings

  • sf_armor_builder Default : 20Engineer armour
  • sf_armor_heavysoldier Default : 75Soldier armour
  • sf_armor_rocketeer Default : 40Rocketeer armour
  • sf_armor_scout Default : 15Scout armour
  • sf_armor_sniper Default : 0Sniper armour
  • sf_health_builder Default : 80 – Engineers health
  • sf_health_heavysoldier Default : 100 – Soldiers health
  • sf_health_rocketeer Default : 100 – Rocketeers health
  • sf_health_scout Default : 100 – Scouts health
  • sf_health_sniper Default : 75 – Snipers health
  • sf_player_limits_enabled Default : 1 – Enables/disables percentage based class limiting
  • sf_player_limits_engineer_percentage Default : 75 – Percentage limit for engineer
  • sf_player_limits_rocketeer_percentage Default : 60 – Percentage limit for rocketeer
  • sf_player_limits_scout_percentage Default : 100 – Percentage limit for scout
  • sf_player_limits_sniper_percentage Default : 25 – Percentage limit for sniper
  • sf_player_limits_soldier_percentage Default : 66 – Percentage limit for soldier
  • sf_run_builder Default : 0
  • sf_run_heavysoldier Default : 0
  • sf_run_rocketeer Default : 1
  • sf_run_scout Default : 1
  • sf_run_sniper Default : 0
  • sf_sprint_builder Default : 1
  • sf_sprint_drain_builder Default : 1
  • sf_sprint_drain_heavysoldier Default : 1
  • sf_sprint_drain_rocketeer Default : 1
  • sf_sprint_drain_scout Default : 0
  • sf_sprint_drain_sniper Default : 1
  • sf_sprint_heavysoldier Default : 1
  • sf_sprint_rocketeer Default : 1
  • sf_sprint_scout Default : 1
  • sf_sprint_sniper Default : 1

Flag Settings

  • sf_flag_drop_distance Default : 50 – How far away from you the flag is dropped if you drop it.
  • sf_flag_returntime Default : 30 – Time in seconds for the flag to return itself to its base.
  • sf_flag_x Default : 0 – Unknown
  • sf_flag_y Default : 0 – Unknown
  • sf_flag_z Default : 100 – Unknown

League Commands

  • league_flip cmd – Flips teams over, while maintaining scores.
  • league_flipscores cmd – Flips scores only
  • league_flipteams cmd – Flips teams only

Map Elements

  • sf_charger_armor_increment Default : 2 – Suit charger speed
  • sf_charger_health_increment Default : 2 – Health charger speed

Undocumented / Beta Commands

  • sf_ar2_range1_damage Default : 0 – Beta cvars used to test the dissipating power/range ratios on the AR2.
  • sf_ar2_range1_distance Default : 1000 – See above.
  • sf_ar2_range2_damage Default : 0 – See above.
  • sf_ar2_range2_distance Default : 2000 – See above.
  • sf_deny_respawn Default : 0 – Unknown, probably beta command.

Weapon Settings

  • sf_damage_crossbow Default : 100Crossbow damage
  • sf_damage_rpg Default : 125RPG damage (if hit directly. Damage dissipates the further from explosion you are)
  • sf_grenade_throw_force_multiplier Default : 800 – Controls range of grenades

Half Life 2 Deathmatch Commands

For a more complete list of console commands for Half-Life 2, see the HL2World wiki. Some of the most common and useful commands are shown below.

Useful Commands

  • sv_cheats Default : 0 – Server setting that turns cheat mode on or off.
  • sv_lan Default : 0Server setting, value of 0 is an internet server, 1 is a LAN server.
  • ip Default : localhostServer setting, needs to be changed to global IP address on servers utilizing routed Internet connections.

Using Cheat Codes

The following commands require that the server have cheats enabled.

  • impulse 101 cmd – Gives you one of every weapon. Needs cheats
  • impulse 200 cmd – Removes your HUD good for taking screenshots. Needs cheats
  • impulse 203 cmd – Removes an entity, used for removing SourceForts blocks. Needs cheats Warning: Using this on players will crash your server

Spawning Blocks

If the cheat mode is turned on players can give themselves blocks, without using a blockspawner. This adds to the blueteams block limit, so it is considered a cheat.

*give prop_block_2d_1x2
*give prop_block_2d_2x3
*give prop_block_2d_1x5
*give prop_block_3d_1x2
*give prop_block_3d_1x1