How to create a debian package

method 1
see also
supposing anything-sync-daemon-5.76 contains all package's files

Than simply create anything-sync-daemon-5.76/DEBIAN/control file with a similar content:
Package: anything-sync-daemon
Version: 5.76
Section: Utilities
Priority: optional
Architecture: amd64
Maintainer: Gigi Kent <>
Description: anything sync daemon

then run
dpkg-deb --build anything-sync-daemon-5.76
dpkg-deb -c anything-sync-daemon-5.76.deb
sudo dpkg -i anything-sync-daemon-5.76.deb
method 2 (problem: will include only the doc files ...)
see also
sudo apt-get install build-essential
e.g. for anything-sync-daemon
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ubuntu_packages/*/$NEW_BUILD_NAME-*
build command was something like this: make install DESTDIR=$NEW_BUILD_NAME_AND_VER

e.g. package anything-sync-daemon
at this point anything-sync-daemon-5.76.tgz must exists!
bzr dh-make anything-sync-daemon 5.76 anything-sync-daemon-5.76.tgz
find anything-sync-daemon
cd anything-sync-daemon/debian
rm *ex *EX
rm README.source README.Debian
take the Ubuntu release name
lsb_release -a | grep Codename | awk '{print $2}'
and use it here (e.g. wily):
sed -i s/"unstable"/"wily"/ changelog
sed -i s/"gigi <gigi@unknown>"/"Gigi Kent <>"/ changelog
sed -i s/"gigi <gigi@unknown>"/"Gigi Kent <>"/ control
sed -i s/"Section: unknown"/"Section: Utilities"/ control
also fill Description in control file

Finally commit the code to your packaging branch
cd ..
now you should be back to the anything-sync-daemon directory
bzr add debian/source/format
bzr commit -m "Initial commit of Debian packaging ($NEW_BUILD_NAME)."
building the package
bzr builddeb -- -us -uc
lesspipe ../anything-sync-daemon_5.76-1_amd64.deb
check deb file for errors
lintian ../anything-sync-daemon_5.76-1_amd64.deb -> for single binary
lintian ../anything-sync-daemon_5.76-1_all.deb -> for indep binary
list deb content
dpkg-deb -c ../anything-sync-daemon_5.76-1_amd64.deb
dpkg-deb -c ../anything-sync-daemon_5.76-1_all.deb

	bzr: ERROR: Unable to determine your name
	Please, set your name with the 'whoami' command.
	bzr whoami "firstname name <email address>"
	bzr whoami "Gigi Kent <>"

Compiling anything sync daemon

Environment variables
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ubuntu_packages/*/$NEW_BUILD_NAME-*

Download and unpack
cd $HOME/compile
tar xpvf anything-sync-daemon-5.76.tar.xz

cd $HOME/compile/anything-sync-daemon-5.76
with systemd use
export DESTDIR=$HOME/temp/$NEW_BUILD_NAME_AND_VER;make V=1 install-systemd-all
with upstart use
export DESTDIR=$HOME/temp/$NEW_BUILD_NAME_AND_VER;make V=1 install-upstart-all

cd $HOME/temp
will yield e.g. anything-sync-daemon-5.76.tgz

check for overlay:
sudo modprobe -c | grep overlay
edit in /etc/asd.conf:
check defined target directories:
grep -nr WHATTOSYNC /etc/asd.conf
preview mode (parse) command:
asd p
service management commands:
sudo systemctl status asd
sudo systemctl enable asd
sudo systemctl start asd

systemd service customization
use /etc/systemd/system/asd-resync.timer.d/frequency.conf
Description=Timer for Arofile-sync-daemon - 10min
# Empty value resets the list of timers

See also

Make ubuntu or applications run faster

See also

Check ubuntu startup times
systemd-analyze blame


mount | grep -P "^tmpfs.+/(tmp|var/run)"
sudo du -sh /tmp /var/tmp; du -sh /********/apps/tmp /********/apps/var/run /run/user/`id -u` /tmp/tomcat 2>/dev/null
tmpfs /tmp tmpfs defaults,relatime,mode=1777,size=4G 0 0
tmpfs /var/tmp tmpfs defaults,relatime,mode=1777,size=99G 0 0
tmpfs /********/apps/tmp tmpfs defaults,relatime,mode=1777,size=2G 0 0
tmpfs /********/apps/run tmpfs rw,nosuid,noexec,relatime,mode=755,size=2G 0 0

Firefox cache
see also
see also

Main disadvantages of this method are that the content of currently browsed web pages is lost if browser 
crashes or after a reboot, and that the settings need to be configured for each user individually.

Open the url: about:config.
browser.cache.disk.enable false
browser.cache.disk.capacity 512000 -> 500M
browser.cache.memory.max_entry_size 512000 -> 500M appcache
browser.cache.memory.enable true
browser.cache.memory.capacity 1048576 -> 1G RAM
See the result in about:cache?device=memory (might require a firefox restart).

Increase the Speed at Which Firefox loads pages
see also
see also

1. Type “about:config” into the address bar and hit Enter.
(Normally the browser will make one request to a web page at a time. When you enable pipelining it will make several at once, which really speeds up page loading.)

2. Alter the entries as follows:
Set “network.http.pipelining” to “true”
Set "network.http.pipelining.ssl” to “true”
see also network.http.proxy.pipelining
network.http.pipelining.maxrequests -> default 32; modified to 6
content.notify.ontimer -> created with value true (default anyway)
content.notify.backoffcount -> created with value 3 (default -1)
content.notify.interval -> default 120 000 microseconds; modified to 500 000

Chromium cache
see also
see also the cache chrome://cache/ -> takes an age to load ...
Allocate Chromium 1G of disk cache by modifying in any chromium-browser.desktop (Exec=chromium-browser lines):
chromium-browser --disk-cache-size=1073741824 --disk-cache-dir=/var/tmp/chromium-cache ...
see also

Improve chrome performance
Navigate to chrome://flags and chrome://gpu/.
See video card info at

Enable these in chrome://flags/:
Enable experimental canvas features
Override software rendering list - canceled
Number of raster threads - 4
Enable GPU rasterization
Enable zero-copy rasterizer
Simple Cache for HTTP
Disable touch adjustment
Enable TCP Fast Open
LCD text antialiasing
Enable Download Resumption

Disable these in chrome://flags/:
Enable touch events
Enable pinch scale

Startup parameters:
grep "Exec=" /usr/share/applications/chromium-browser.desktop
grep "Exec=" $HOME/.local/share/applications/chromium-browser.desktop
Exec=chromium-browser --process-per-site --disk-cache-size=1073741824 --disk-cache-dir=/var/tmp/chromium-cache --enable-native-gpu-memory-buffers %U
Exec=chromium-browser --process-per-site --disk-cache-size=1073741824 --disk-cache-dir=/var/tmp/chromium-cache --enable-native-gpu-memory-buffers
Exec=chromium-browser --process-per-site --disk-cache-size=1073741824 --disk-cache-dir=/var/tmp/chromium-cache --enable-native-gpu-memory-buffers --incognito
Exec=chromium-browser --process-per-site --disk-cache-size=1073741824 --disk-cache-dir=/var/tmp/chromium-cache --enable-native-gpu-memory-buffers --temp-profile

Firefox & Chromium profile
see also
see also
see also
sudo add-apt-repository ppa:graysky/utils
sudo apt-get update
sudo apt-get install profile-sync-daemon
psd p -> creates /********/.config/psd/psd.conf
Primary configuration:
gedit /********/.config/psd/psd.conf
USERS="gigi bob"
Add to /etc/sudoers (required by psd.service USE_OVERLAYFS="yes"):
gigi ALL=(ALL) NOPASSWD: /usr/bin/psd-overlay-helper
secondary configuration
mkdir -p ~/.config/systemd/user/psd-resync.timer.d
gedit ~/.config/systemd/user/psd-resync.timer.d/frequency.conf
Description=Timer for Profile-sync-daemon
Enable & start the service:
systemctl --user enable /usr/lib/systemd/user/psd.service
systemctl --user start psd
systemctl --user status psd
Stop & disable the service:
systemctl --user stop psd
systemctl --user disable psd
Check psd installation & configuration:
profile-sync-daemon parse
psd p
ls -l ~/.mozilla/firefox/
ls -l /run/user/`id -u`

Server -> Transcoder: /var/tmp/plex-transcoding

Linux hdd defragmentation
see also

HDD performance
see also
see also
see also

hdd performance info
echo "queue_depth: $(cat /sys/block/sda/device/queue_depth)"; echo "nr_requests: $(cat /sys/block/sda/queue/nr_requests)"; echo "read_ahead_kb: $(cat /sys/block/sda/queue/read_ahead_kb)"
echo "queue_depth: $(cat /sys/block/sdb/device/queue_depth)"; echo "nr_requests: $(cat /sys/block/sdb/queue/nr_requests)"; echo "read_ahead_kb: $(cat /sys/block/sdb/queue/read_ahead_kb)"

Queue_depth (default 31)
cat /sys/block/sda/device/queue_depth
cat /sys/block/sdb/device/queue_depth

I/O scheduler queue size (default 128)
How many requests may be allocated in the block layer for read or write requests.
cat /sys/block/sda/queue/nr_requests
su	-> won't work using sudo ...
echo 1024 > /sys/block/sda/queue/nr_requests
cat /sys/block/sdb/queue/nr_requests
echo 1024 > /sys/block/sdb/queue/nr_requests

Maximum number of kilobytes to read-ahead
cat /sys/block/sda/queue/read_ahead_kb	-> default 128
cat /sys/block/sdb/queue/read_ahead_kb

Print readahead in 512-byte sectors (
sudo blockdev --getra /dev/sda		-> default 256 (always double to read_ahead_kb above)
sudo blockdev --getra /dev/sdb

This file (/sys/block/sda/queue/add_random) allows to turn off the disk entropy contribution. Default value of this file is '1'(on).
cat /sys/block/sdb/queue/nr_requests
su	-> won't work using sudo ...
echo 1 > /sys/block/sdb/queue/nr_requests

Persist using /etc/rc.local
blockdev --setra 256 /dev/sda
echo 1 > /sys/block/sda/queue/add_random

Disable IPv6 support
Check ipv6 status (1 = disabled)
cat /proc/sys/net/ipv6/conf/all/disable_ipv6

Add to /etc/sysctl.conf

Disable loading of ivp6 module into kernel during booting
see also
Edit /etc/modprobe.d/blacklist.conf
blacklist ipv6

This option controls the tendency of the kernel to reclaim the memory which is used for caching of directory and inode objects.
At the default value of vfs_cache_pressure=100 the kernel will attempt to reclaim dentries and inodes at a "fair" rate with respect to pagecache and swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer to retain dentry and inode caches. When vfs_cache_pressure=0, the kernel will never reclaim dentries and inodes due to memory pressure and this can easily lead to out-of-memory conditions. Increasing vfs_cache_pressure beyond 100 causes the kernel to prefer to reclaim dentries and inodes.