Posts

Showing posts from 2017

Set color for vi editor

Step 1: Create .vimrc in your home touch ~/.vimrc Step 2: Add content to .vimrc which you just created syntax on colorscheme desert Step 3: Logout and re-login End.

Testing disk performance on Linux

Laptop Throughput (Streaming I/O) One gigabyte was written for the test, first with the cache activated (hdparm -W1 /dev/sda): root@grml ~ # dd if=/dev/zero of=/root/testfile bs=1G count=1 oflag=direct 1+0 records in 1+0 records out 1073741824 bytes (1.1 GB) copied, 32.474 s, 33.1 MB/s root@grml ~ # Then, with the cache deactivated (hdparm -W0 /dev/sda): root@grml ~ # dd if=/dev/zero of=/root/testfile bs=1G count=1 oflag=direct 1+0 records in 1+0 records out 1073741824 bytes (1.1 GB) copied, 123.37 s, 8.7 MB/s root@grml ~ # Laptop Latency In this test, 512 bytes were written one thousand times, first with the cache activated (hdparm -W1 /dev/sda): root@grml ~ # dd if=/dev/zero of=/root/testfile bs=512 count=1000 oflag=direct 1000+0 records in 1000+0 records out 512000 bytes (512 kB) copied, 0.36084 s, 1.4 MB/s root@grml ~ # Then, with the cache deactivated (hdparm -W0 /dev/sda): One thousand accesses required 11.18 seconds, meaning one access took 11.18 ms. root@gr

[Golang] The project directory structure

Image
This is a basic layout for Go application projects. It represents the most common directory structure with a number of small enhancements along with several supporting directories common to any real world application. Go Directories /cmd Main applications for this project.  The directory name for each application should match the name of the executable you want to have (e.g., /cmd/myapp).  Don't put a lot of code in the application directory unless you think that code can be imported and used in other projects. If this is the case then the code should live in the /pkg directory.  It's common to have a small main function that imports and invokes the code from the /internal and /pkgdirectories. /internal Private application and library code.  Put your actual application code in the /internal/app directory (e.g., /internal/app/myapp) and the code shared by those apps in the /internal/pkg directory (e.g., /internal/pkg/myprivlib). /pkg Library code that&

[MacOS] Open a minimized windows by shortcut keyboard

Step 1:  Command   +   Tab   until you get the app's icon. Step 2:  Before releasing   Command , press and hold   ⌥   (option). End. P/S:  Command   +   M  to minimize a opening window

[Linux] Open terminal from Nautilus - Gnome file management (Redhat/Centos/Fedora)

Image
This is a tut "Open terminal from Nautilus". - Step 1: Install  nautilus-open-terminal package sudo yum install nautilus-open-terminal -y - Step 2: Stop all nautilus is opened killall -9 nautilus - Step 3: Re-open nautilus and click right mouse in nautilus windows, choose "Open in Terminal"

How to remove a milion files on Linux?

Normally, I used to  rm  command to remove file on Linux. Today, I must to remove more a milion files, do you use rm command to do this??? The answer for this question to be "NO". After I have Googled and the solution for this issue you try to use "rsync" command. rsync -a --delete /tmp/empty /tmp/session/ Wonderful, I removed more a milion files smoothly.... Which is the fastest? rm: deleting millions of file is a no-can-do! find -exec: an option, but slower! find -delete: fast and easy way to remove loads of files. rsync --delete: without doubt the quickest!

Run/Open VSCode from terminal in MacOS

Image
Open Visual Studio Code and press  Command  +  Shift  +  P  then type  Shell  in command palette now you are able to find this option like  Shell Command : Install code in PATH  from suggested list in command palette. Select that options.