no sense news
NO SENSE NEWS FROM THE WEB
NO SENSE NEWS FROM THE WEB
Jul 31st
What is swap?
Swap space is the area on a hard disk which is part of the Virtual Memory of your machine, which is a combination of accessible physical memory (RAM) and the swap space. Swap space temporarily holds memory pages that are inactive. Swap space is used when your system decides that it needs physical memory for active processes and there is insufficient unused physical memory available. If the system happens to need more memory resources or space, inactive pages in physical memory are then moved to the swap space therefore freeing up that physical memory for other uses. Note that the access time for swap is slower therefore do not consider it to be a complete replacement for the physical memory. Swap space can be a dedicated swap partition (recommended), a swap file, or a combination of swap partitions and swap
files.
Why do I need swap?
Memory consuming programs Sometimes, a large program (like MySQL) make the entire system need extra memory. A significant number of the pages used by these large programs during its startup may only be used for initialization and then never used again. The system can swap out those pages and free the memory for other programs or even for the disk cache. In these cases, swap will be used to help the system handle any extra load.
Hibernation (suspend-to-disk) The hibernation feature (suspend-to-disk) writes out the contents of RAM to the swap partition before turning off the machine. Therefore, your swap partition should be at least as big as your RAM size. The hibernation implementation currently used in Ubuntu, swsusp, needs a swap or suspend partition. It cannot use a swap file on an active file system.
Unforeseeable Circumstances Unforeseeable events can and will happen (a program going crazy, some action needing much more space than you thought, or any other unpredictable combination of events). In these cases, swap can give you an extra delay to figure out what happened, or to finish what you are working on.
Symptoms
MySQL is being slow and when we run programs like ‘top’ we can see that our process (or server) is using a large quantity of swap.
What is this affecting the MySQL performance ?
MySQL will change the way works since it will replace the internal algorithms to be optimized for Disk I/O due the navy use of swap. This will make the system slower.
What we can do ?
First we need to figure out how much swap is the system using and how much free memory does it have.
1) The first trick we can do is to drop disk caches, this will free some more memory:
echo 3 > /proc/sys/vm/drop_caches
2) If we can move the swap into real memory (swap usage < free memory) we can run:
swapoff -a (to disable the swap usage, this will force to move data to memory)
swapon -a (will re-enable use of swap)
3) Check to see how aggressive is the system setup to use swap by using:
cat /proc/sys/vm/swappiness
I personally prefer to have this value around 10 (0 no not use swap – 100 use swap)
to change this
edit /etc/sysctl.conf and add a new line “vm.swappiness=10“. Save the file and run
sysctl -f /etc/sysctl.conf
4) Make sure that mysql is allocating memory close to equal for each physical CPU (not core), you may check this by typing
numactl –hardware
due the NUMA architecture this may be one of the main issue why mysql is swapping in the first place.
Mar 4th
get the tools for building the kernel
apt-get -y install build-essential libncurses5-dev fakeroot kernel-package linux-source
the kernel source code will be in /usr/src/
go to /usr/src and decompress the kernel
tar -xjf linux-source-2.6.28.tar.bz2
and make a symlink
ln -s /usr/src/linux-source-2.6.28 linux
now go the the kernel menu and select what options do you want to compile in your kernel
make menuconfig
next, rebuild the kernel
cd /usr/src/linux
fakeroot make-kpkg --initrd --revision=subzero.1.0 kernel_image
Mar 4th
Did you use mac ports, and after each update your ports are getting bigger and bigger ? Do you want to cleanup a few hundred of MB ? This is how you do it!
In order to see what is installed on your machine
port installed
to checkout the last version of the ports from the repository
sudo port -v selfupdate
howto update the ports
sudo port upgrade outdated
now to clean all the old version
sudo port clean --all installed
Mar 4th
You can access a remote file system securely using sshfs and fuse which is a command to mount a remote filesystem encrypted through ssh.
This way you will be able to access remote files as if they were on you machine, just remember that if the connection between the computers is slow, the access will also be pretty slow
Package needed
sshfs
fuse-utils
Installation
Get the packages
For Debian: apt-get install fuse-utils sshfs
For Ubuntu: sudo apt-get install fuse-utils sshfs
For Fedora and Centos: yum install fuse-utils sshfs
For Mandriva: urpmi: urpmi fuse-utils sshfs
Next step is to mount the fuse module
modprobe fuse
Next create the mount point
mkdir /mnt/remote-fs
chown [your-user]:[your-group] /mnt/remote-fs/
Add yourself to the fuse group
adduser [your-user] fuse
Untill here all the command should be issued as root, now switch to your users and mount the remote filesystem.
sshfs remote-user@remote.server:/remote/directory /mnt/remote-fs/
It will now ask you accept the key if this is the first time you connect to that PC using ssh, and then the password, or only the password if this is not the first time you use ssh to connect to the remote server . That should be all.
Aug 15th
Ok, so you fixed the last PDF vulnerability by updating your iPhone/iPad/iPod to 4.0.2 … cool … but you decide that you still want to jailbreak your device … can you do it ? Yes !

According to people the
More >
Aug 15th
Since Apple released and update 4.0.2 on iPhone/iPad/iPod OS to fix the latest PDF vulnerability that allow to run code into your mobile device running iOS4, the things are clear a jailbreak from jailbreakme.com is not possible anymore, since the PDF vulnerability is fixed. But what happens if you’re running and older version of the iOS like iOS 3.1.3 (reasons not to update? becouse on older devices is still faster then the iOS4 …) ? Right, you guessed, you’re still at risk since the vulnerability was not addressed there… so how can you be safe … there is an app for that on …

Cydia store … and in order to get that you need to jailbreak your phone … do you see the irony ??? …. and the no sense …
Aug 13th
It is alarming how easy and elegant was this new iPhone/iPod/iPad jailbreak for devices running iOS up to 4.0.1. The exploit , this time from the iPhone Dev Team, called a “beautiful work” by some security researchers is exploiting a vulnerability into the iPhone Safari browser that allows for a back door access, while opening and viewing PDF files. The cool/scarry thing is that this can be exploited just by visiting a webpage that contain this code (www.jailbreakme.com).
The cool thing about this jailbrake is that you can revert any time (if you backup your device, please do that !!!) at your previous ‘official’ firmware from Apple.
Now while this jailbreak is safe and legal, we wonder how long it will take until this vulnerability (already ported to metasploit) may install ‘backdoors’ on your device (well, other then the ones from Apple).
More >
Jul 30th
Soon after Apple has gotten the iPhone3 antenna problem out from the news by offering free bumpers and saying that other phones have the same problem another issues is hitting the iPhone, this time iPhone 3G
It seems that the iPhone 3G owners who upgraded to the new iOS4 are complaining that the iOS4 is killing the performance of their mobile phones, and they hope that they will see soon an fix from the company from Cupertino. Apple has reported that they begun an investigation about the issue since they have a lot of complains (people are reporting on their blogs about this all over the globe). So should you upgrade your iPhone 3G to the new iOS4 ? Probably not, just wait until the next iOS4 update.
More >
Jul 27th
If you own an iPhone and want to “jailbreak” it in order to install non-Apple-certified applications, good news – it’s now considered perfectly legal, according to the United States government.
Statement of the Librarian of Congress Relating to Section 1201 Rulemaking
Section 1201(a)(1) of the copyright law requires
This is the fourth time that I have made such a determination. Today I have designated six classes of works. Persons who circumvent access controls in order to engage in noninfringing uses of works in these six classes will not be subject to the statutory prohibition against circumvention.
More >
Jul 26th
I was trying to get all the local IP addresses (public and private) in python , and the standard socket library seems to provide only information about the IP that resolve your hostname. Here is a quick way how to list all your ip from all interfaces in python.
First you need to install the python netifaces module:
On a debian system you can install the module like this:
sudo apt-get install python-netifaces
You’re done, now you can write the code:
from netifaces import interfaces, ifaddresses, AF_INET
for ifaceName in interfaces():
addresses = [i['addr'] for i in ifaddresses(ifaceName)[AF_INET]]
print ‘%s: %s’ % (ifaceName, ‘, ‘.join(addresses))
on my computer I have an output like this:
lo: 127.0.0.1
eth0: 1.1.1.1
eth1: 192.168.0.1
No Sense ?
Recent Comments