C const pointer

const int x=2; // x is a constant
const int * const p=&x;

// first const is for the x the next is to make the pointer only point to a constant address, in this case &x.

read under bash

#!/bin/sh

read -p "Press enter to continue" var

The version of read used by bash doesn’t like it if you don’t give it a variable

Debian increase wifi upload speed

The upload speed at debian is much lower than at Windows 10 but it can be fixed.

I am using a intel card with 40 mbps download speed and 7 mbps upload speed.

$ lspci
03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] (rev 34)

$ lsmod |grep iw
iwldvm 139264 0
mac80211 671744 1 iwldvm
iwlwifi 151552 1 iwldvm
cfg80211 589824 3 iwlwifi,mac80211,iwldvm

So I am using the iwlwifi driver, and I saw a big increase in upload speed at ookla speedtest just changing this:

echo "options iwlwifi 11n_disable=8" | sudo tee -a /etc/modprobe.d/iwlwifi.conf

The option iwlwifi 11n_disable=8 enables Tx aggregation, enabling the interface to push larger packets per second.

Reboot and he result is 40mbps download speed and 60mbps upload speed.

thinkpad x230 i7 fan noise with Ubuntu 16.04-2

My thinkfan.conf is working but it still makes a lot of noise (and with Ubuntu 14 and Debian 8 it didn’t)

root@x230:/home/iker# cat /etc/thinkfan.conf

hwmon /sys/devices/virtual/hwmon/hwmon0/temp1_input
hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon1/temp3_input
hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon1/temp1_input
hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon1/temp2_input

(0, 0,  53)
(1, 53, 66)
(2, 64, 68)
(3, 66, 70)
(4, 68, 73)
(5, 71, 76)
(7, 74, 32767)

mushroom risotto

Ingredients for 2 people:

two small onions or one big onion
two hundred grams of mushrooms
180 gram of rice
two cloves of garlic
extra virgin olive oil
butter 10 grams
black pepper
parmesan cheese (optional)

1) cut onions in small pieces
2) put the onions in a pan and a little bit of watter on number 7/10 for 5 minutes.
check that they don’t burn.
3) Boil some water in the kettle
4) cut the mushrooms and the garlic
5) put the rice with the onions and add some water. mix every couple of minutes.
when the water is finished add more water
6) put the mushrooms and the garlic in a pan
7) mix every minute
8) grate the parmesan cheese
9) When the rice is ready [about 10 minutes] add pepper and parmesan cheese. mushrooms and a  bit of water.