Blog Spot!


Run a script on linux boot - startup

You can use crontab

Edit crontab:

$ sudo crontab -e

The first time it will ask you which editor you wish to edit with.

Once in the editor add the following line:

@reboot /usr/local/bin/forever start /your/path/to/your/app.js

Save the file.

Reboot.

stackoverflow
cron-man
cyberciti

Added on 11.Jan.2016
Tags: linux cron boot autostart forever nodejs

How to defrag your Linux system

There is a common misconception among GNU/Linux users that our systems never ever need to be defragmented. This stems from the success of the journalized filesystems used by most distributions including EXT2,3 and 4, JFS, ZFS, XFS, ReiserFS and BTRFS. All of these boast smart ways and techniques in regards to the files allocation in the disks, minimizing the fragmentation problem to a point that there is practically no reason to defrag even after many years of installing and uninstalling applications and libraries in the same system. Fragmentation though can still be an issue though, especially for users that use space limited disks that may not offer many file allocation options.

The e4defrag program is part of the e2fsprogs package which should already be installed on your computer. In case the program is missing, install it with this command on Ubuntu:

sudo apt-get install e2fsprogs

To do this I use the following command, followed by the location and name of the file:

sudo e4defrag <file_name>

This is good when you have to defrag just a couple of files, but if you want to defrag your whole system then you should first unmount all partitions and run the following command:

sudo e4defrag /dev/*

If you want to perform defrag without unmounting, this would be a safe choice.:

sudo e4defrag /

Since many users nowadays use SSDs and not HDDs, it is important to note that the defragmentation procedure is only beneficial for the later. If you own an SSD, there is simply no point in worrying about fragmented files as those disks can access their storage randomly, wheres HDDs access sequentially. Defragging your SSD will only increase the read/write count and thus reduce the lifetime of your disk. SSD owners should convey their interest on the TRIM function instead, which is not covered in this tutorial.

howtoforge

Added on 11.Jan.2016
Tags: linux defragment tools

Finding the max value of an attribute in an array of objects

biggest = Math.max.apply(Math, data.map(function(o) {
    return o.biggest;
}));

stackoverflow

Added on 05.Jan.2016
Tags: js max value array object find

Use NFS to share file between systems if there is no windows involved

Install nfs-kernel-server Install nfs-kernel-server and nfs-common Install nfs-common on the computer that has the files to be shared. These can be installed in the Software Center, or however you prefer to install packages. You can install them on the command-line with:

sudo apt-get update && sudo apt-get install nfs-kernel-server nfs-common

You need to edit the exports file that shows what to share and with whom. So run:

gksu gedit /etc/exports

For example, to give full read and write permissions, allowing any computer from 192.168.1.1 through 192.168.1.255, add this line to /etc/exports:

/directory_to_share 192.168.1.1/24(rw,no_root_squash,async)

Restart the NFS server by running:

sudo /etc/init.d/nfs-kernel-server restart

(Or just reboot the computer.)

From now on after editing the /etc/exports file, you can just run sudo exportfs -a to apply the changes.

The showmount cmommand will show you all available shares, if all went well.

An fstab entry must be added to have your computers nfs-client mount another computers exports @ boot time. gksu gedit /etc/fstab will edit the required file.

192.168.0.200:/srv/nfs  /media  nfs  rsize=8192 and wsize=8192,noexec,nosuid

Reboot and the share is mounted in /media.

Set up a server on the client and client on the server for two-way shares.

You can print to a shared printer with CUPS (as mentioned in this answer).

..article from askubuntu

Added on 27.Dec.2015
Tags: linux share nfs howto

15 free, excellent programs for your PC needs

New hardware needs new software

pcworld

Tests

stress testing
benchmarking

Added on 25.Dec.2015
Tags: windows pc programs needs article

Search


PHP Libraries


Carbon lib / docs
Idiorm lib / docs
Image Workshop lib / docs
lorenzos/Minixed lib / docs
Parsedown lib / docs
PHP Paginator lib / docs
PHP Redis lib / docs
QrCode lib / docs
Requests lib / docs
Slim lib / docs
Spyc lib / docs
TWIG lib / docs
Upload lib / docs
Validation lib / docs
Zebra Image lib / docs

JS Libraries


AJV lib / docs
BackboneJS lib / docs
Bootstrap Notify lib / docs
C3.js lib / docs
ChartJS lib / docs
FastMD5 lib / docs
HighlightJS lib / docs
jQuery-Storage lib / docs
JS-Cookie lib / docs
Leaflet JS lib / docs
LowDB lib / docs
Marked lib / docs
NeedlyJS lib / docs
ParcelJS lib / docs
RequireJS lib / docs
Swig lib / docs
Toastr lib / docs
Underscore lib / docs
ValidateJS lib / docs
top