You can increase the network performance by override the default settings:
cat /etc/sysctl.conf
vm.swappiness = 10
vm.vfs_cache_pressure = 500
net.core.netdev_max_backlog = 4096
net.core.wmem_max = 1048568
net.core.rmem_max = 1048568
net.ipv4.tcp_wmem = 8192 32768 2027520
net.ipv4.tcp_rmem = 8192 131072 2027520
net.ipv4.tcp_mem = 32768 98304 131072
net.core.optmem_max = 32768
To the meaning of them, please check in man.
Sunday, 8 March 2015
Sunday, 8 February 2015
Replace default notepad
There is a little trick to replace windows' default text editor to anyone.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe]
"Debugger"="c:\\Program Files\\EmEditor\\EmEditor.exe"
There is only issue with this:
because of the Debugger string purpose of set up a debugger application the notepad called with the following form:
c:\\Program Files\\EmEditor\\EmEditor.exe c:\\windows\\notepad.exe
So in emeditor always try to open notepad.exe too.
So better alternative use the http://www.binaryfortress.com/notepadreplacer/
or you have to write a wrapper exe.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe]
"Debugger"="c:\\Program Files\\EmEditor\\EmEditor.exe"
There is only issue with this:
because of the Debugger string purpose of set up a debugger application the notepad called with the following form:
c:\\Program Files\\EmEditor\\EmEditor.exe c:\\windows\\notepad.exe
So in emeditor always try to open notepad.exe too.
So better alternative use the http://www.binaryfortress.com/notepadreplacer/
or you have to write a wrapper exe.
Saturday, 7 February 2015
Get the progress of dd
I found a good article how to get the progress of dd.
dd is a popular, generic
command-line tool for copying files from 1 location to another. It is
often used to copy entire disk images.
Like many Linux command line tools, it operates silently unless something unexpected happens. Its lack of visual progress feedback is a nice feature for scripting. However, it can leave you wondering about its progress if you are interactively dd-copying a large disk.
To illustrate, you run the following (valid, but perhaps not very useful) dd copy:
It will run for a few minutes as it copies (and immediately discards) 100 blocks of randomly generated data, each of size 1 KB.
To get a progress report while dd is running, you need to open another virtual terminal, and then send a special USR1 signal to the dd process.
First, find out the process id of the dd process by running the following in the new virtual terminal.
To send the USR1 signal to the dd prcoess:
Note that as soon as the USR1 signal is detected, dd will print out the current statistics to its STDERR.
After reporting the status, dd will resume copying. You can repeat the above kill command any time you want to see the interim statistics. Alternatively, you can use the watch command to execute kill at a set interval.
Show progress during dd copy
Like many Linux command line tools, it operates silently unless something unexpected happens. Its lack of visual progress feedback is a nice feature for scripting. However, it can leave you wondering about its progress if you are interactively dd-copying a large disk.
To illustrate, you run the following (valid, but perhaps not very useful) dd copy:
$ dd if=/dev/random of=/dev/null bs=1K count=100
It will run for a few minutes as it copies (and immediately discards) 100 blocks of randomly generated data, each of size 1 KB.
To get a progress report while dd is running, you need to open another virtual terminal, and then send a special USR1 signal to the dd process.
First, find out the process id of the dd process by running the following in the new virtual terminal.
$ pgrep -l '^dd$' 8789 dd $
To send the USR1 signal to the dd prcoess:
$ kill -USR1 8789 $
Note that as soon as the USR1 signal is detected, dd will print out the current statistics to its STDERR.
$ dd if=/dev/random of=/dev/null bs=1K count=100 0+14 records in 0+14 records out 204 bytes (204 B) copied, 24.92 seconds, 0.0 kB/s
After reporting the status, dd will resume copying. You can repeat the above kill command any time you want to see the interim statistics. Alternatively, you can use the watch command to execute kill at a set interval.
$ watch -n 10 kill -USR1 8789
Ref.:http://linuxcommando.blogspot.hu/2008/06/show-progress-during-dd-copy.html
Saturday, 18 October 2014
Linux sucks: Xubuntu 14.04 on Asus G55VW
I would like to install Xubuntu to my notebook (G55VW). The most of things works fine, except FN-keys (FN-F4...FN-F6, yeah the LCD&keyboard brightness controls). I read many forums but most of way didn't get solution. I tried most of and here is my version:
1. get and install
https://github.com/guillaumezin/nvidiabl
Install:
sudo make dkms-install
To remove:
sudo make dkms-remove
2. Update grub
vim /etc/defaults/grub
add "acpi_backlight=vendor" to cmdline
sudo update-grub2 && sudo reboot
3. reboot
Set brightness to the half of max.br:
echo -n 50 | sudo tee /sys/class/backlight/nvidia_backlight/brightness
4. Disable using of the profiles in nvidia-settings.
I had issue with Wireless:
1. get and install
https://github.com/guillaumezin/nvidiabl
Install:
sudo make dkms-install
To remove:
sudo make dkms-remove
2. Update grub
vim /etc/defaults/grub
add "acpi_backlight=vendor" to cmdline
sudo update-grub2 && sudo reboot
3. reboot
Set brightness to the half of max.br:
echo -n 50 | sudo tee /sys/class/backlight/nvidia_backlight/brightness
4. Disable using of the profiles in nvidia-settings.
I had issue with Wireless:
sudo vim /etc/modprobe.d/iwlwifi.conf
options iwlwifi 11n_disable=1
Saturday, 6 September 2014
Block web-sites with BIND9
I'm skipping the installation and set up of the BIND9 because there are several other site that do it. I just explain how to configure named.conf to be able to block domains.
You'll need a 'null.zone.file' under etc folder:
; DNS NULL Zone File for host filtering
$TTL 36000
@ in soa localhost. postmaster.localhost. (
0 ;serial
0 ;refresh
0 ;retry
0 ;expiration
0 ) ;minimum
; Zone NS records
@ NS localhost.
A 127.0.0.1
* IN A 0.0.0.0
Now see the named.conf:
options {
directory "c:\bind9\etc";
listen-on { 127.0.0.1; };
forwarders { 192.168.100.1;};
#forwarders { 8.8.8.8; 8.8.4.4;};#if you would like to use Google DNS servers
recursion yes;
allow-transfer { none; };
};
logging{
channel my_log{
file "myconf.log" versions 3 size 2m;
severity info;
print-time yes;
print-severity yes;
print-category yes;
};
category default{
my_log;
};
};
key "rndc-key" {
algorithm hmac-md5;
secret "your secret key";
};
controls {
#inet 127.0.0.1 port 953
#allow { 127.0.0.1; } keys { "rndc-key"; };
inet 127.0.0.1 allow { localhost; } keys { "rndc-key"; };
};
zone "gemius.pl" {type master; notify no; file "null.zone.file";};
zone "adserver.yahoo.com" {type master; notify no; file "null.zone.file";};
Now the above website will be blocked and you experience a little more responsibility on web-sites.
Of course you can block unwanted web-sites.
You'll need a 'null.zone.file' under etc folder:
; DNS NULL Zone File for host filtering
$TTL 36000
@ in soa localhost. postmaster.localhost. (
0 ;serial
0 ;refresh
0 ;retry
0 ;expiration
0 ) ;minimum
; Zone NS records
@ NS localhost.
A 127.0.0.1
* IN A 0.0.0.0
Now see the named.conf:
options {
directory "c:\bind9\etc";
listen-on { 127.0.0.1; };
forwarders { 192.168.100.1;};
#forwarders { 8.8.8.8; 8.8.4.4;};#if you would like to use Google DNS servers
recursion yes;
allow-transfer { none; };
};
logging{
channel my_log{
file "myconf.log" versions 3 size 2m;
severity info;
print-time yes;
print-severity yes;
print-category yes;
};
category default{
my_log;
};
};
key "rndc-key" {
algorithm hmac-md5;
secret "your secret key";
};
controls {
#inet 127.0.0.1 port 953
#allow { 127.0.0.1; } keys { "rndc-key"; };
inet 127.0.0.1 allow { localhost; } keys { "rndc-key"; };
};
zone "gemius.pl" {type master; notify no; file "null.zone.file";};
zone "adserver.yahoo.com" {type master; notify no; file "null.zone.file";};
Now the above website will be blocked and you experience a little more responsibility on web-sites.
Of course you can block unwanted web-sites.
Monday, 1 September 2014
TotalCmd Add new custom command
Hotkeys:
SHIFT+F4 create new file
I usually open GitBash. I made a hotkey combination to access faster:
Each config file located under c:\Users\YOURNAME\AppData\Roaming\GHISLER.
WINCMD.INI:
[Shortcuts]
CA+C=em_gitbash
CA+V=cm_ExecuteDOS
usercmd.ini:
[em_gitbash]
button=C:\Windows\System32\WScript.exe,2
cmd="C:\Program Files (x86)\Git\Git Bash.vbs"
path=C:\Windows\System32\
The path is set a location. Remove it if you would like to use at TCM's current folder.
SHIFT+F4 create new file
I usually open GitBash. I made a hotkey combination to access faster:
Each config file located under c:\Users\YOURNAME\AppData\Roaming\GHISLER.
WINCMD.INI:
[Shortcuts]
CA+C=em_gitbash
CA+V=cm_ExecuteDOS
usercmd.ini:
[em_gitbash]
button=C:\Windows\System32\WScript.exe,2
cmd="C:\Program Files (x86)\Git\Git Bash.vbs"
path=C:\Windows\System32\
The path is set a location. Remove it if you would like to use at TCM's current folder.
Subscribe to:
Posts (Atom)