http://code.openark.org/blog/mysql/useful-sed-awk-liners-for-mysql
Wednesday, November 26, 2014
Thursday, November 13, 2014
Isolating CPUs from the general scheduler in Linux.
It could be done using the kernel parameters:
isolcpus=
Format:
<cpu number>,...,<cpu number>
or
<cpu number>-<cpu number>
(must be a positive range in ascending order) or a mixture
<cpu number>,...,<cpu number>-<cpu number>
This option can be used to specify one or more CPUs to isolate from the general SMP balancing and scheduling algorithms. You can move a process onto or off an "isolated" CPU via the CPU affinity syscalls or cpuset.
<cpu number> begins at 0 and the maximum value is "number of CPUs in system - 1".
This option is the preferred way to isolate CPUs. The alternative -- manually setting the CPU mask of all tasks in the system -- can cause problems and suboptimal load balancer performance.
Taken from /usr/share/doc/kernel-doc-2.6.32/Documentation/kernel-parameters.txt
isolcpus=
Format:
<cpu number>,...,<cpu number>
or
<cpu number>-<cpu number>
(must be a positive range in ascending order) or a mixture
<cpu number>,...,<cpu number>-<cpu number>
This option can be used to specify one or more CPUs to isolate from the general SMP balancing and scheduling algorithms. You can move a process onto or off an "isolated" CPU via the CPU affinity syscalls or cpuset.
<cpu number> begins at 0 and the maximum value is "number of CPUs in system - 1".
This option is the preferred way to isolate CPUs. The alternative -- manually setting the CPU mask of all tasks in the system -- can cause problems and suboptimal load balancer performance.
Taken from /usr/share/doc/kernel-doc-2.6.32/Documentation/kernel-parameters.txt
Boot parameters of the running kernel in Linux
Let's say I need to find out with what parameters did the kernel boot?
The following command will give you the answer:
cat /proc/cmdline
For example:
janeiros@harlie:~$ cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.0.0-32-generic-pae root=/dev/mapper/harlie-root ro quiet
The following command will give you the answer:
cat /proc/cmdline
For example:
janeiros@harlie:~$ cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.0.0-32-generic-pae root=/dev/mapper/harlie-root ro quiet
Tuesday, October 28, 2014
Endianness mnemotechnic
In Big Endian, you store the most significant byte in the smallest address. In Little Endian, you store the least significant byte in the smallest address.
http://en.wikipedia.org/wiki/Endianness
Monday, October 27, 2014
Guava Files class
Saturday, October 11, 2014
Foundation and Empire
- Part I: The General
- Search for Magicians
- The Magicians
- The Dead Hand
- The Emperor
- The War Begins
- The Favorite
- Bribery
- To Trantor
- On Trantor
- The War Ends
- Part II The Mule
- Bride and Groom
- Captain and Mayor
- Lieutenant and Clown
- The Mutant
- The Psychologist
- Conference
- The Visi-Sonor
- Fall of the Foundation
- Start of the Search
- Conspirator
- Interlude in Space
- Death on Neotrantor
- The Ruins of Trantor
- Convert
- Death of a Psychologist
- End of the Search
Labels:
Asimov,
Foundation and Empire,
Foundation series
Friday, October 3, 2014
IPTABLES
# List the rules with line numbers,
# the -n disables the DNS reverse lookup
iptables -n --list --line-numbers
# Block a specific IP
iptables -A INPUT -s 192.168.0.1 -j DROP
# Allow SSH for a specific IP
iptables -A INPUT -s 192.168.0.2 -p tcp -m tcp --dport 22 -j ACCEPT
# Delete a rule based on its number
iptables -D INPUT 8
# Insert rule before other certain one
# For example before line # 3
iptables -I INPUT 3 -s 192.168.0.2 -p tcp -m tcp --dport 22 -j ACCEPT
# the -n disables the DNS reverse lookup
iptables -n --list --line-numbers
# Block a specific IP
iptables -A INPUT -s 192.168.0.1 -j DROP
# Allow SSH for a specific IP
iptables -A INPUT -s 192.168.0.2 -p tcp -m tcp --dport 22 -j ACCEPT
# Delete a rule based on its number
iptables -D INPUT 8
# Insert rule before other certain one
# For example before line # 3
iptables -I INPUT 3 -s 192.168.0.2 -p tcp -m tcp --dport 22 -j ACCEPT
Subscribe to:
Posts (Atom)