TL;DR = mp.jwt.token.header=Cookie is your friend.
Friday, April 4, 2025
Tuesday, November 28, 2017
mobile intel wifi & bluetooth problem on Linux
If you have frequent wifi instability with Wifi on this device:
02:00.0 Network controller: Intel Corporation Wireless 7265 (rev 59)
02:00.0 Network controller: Intel Corporation Wireless 7265 (rev 59)
(or, more specificallly):
[ 17.718800] iwlwifi 0000:02:00.0: Detected Intel(R) Dual Band Wireless AC 7265, REV=0x210
... and in dmesg you can see some microcode crash reporting every now and then, try disabling bluetooth coexistence by passing some options to iwlwifi module:
options iwlwifi bt_coex_active=N
(I also have power_save=y 11n_disable=8 but IMMV so try the above alone first).
It seems that altought the bluetooth device *is made by intel and built into the same card*, they don't play along - using bluetooth coexistence signaling makes the wifi defers transmission and probably some timeout leads to a crash - perhaps it's an aggressive watchdog that intel itself left enabled.
Anyway, I now have stable wifi.
Cheers.
BTW in debian/ubuntu what you'd do is this:
# /etc/modprobe.d/iwlwifi.conf
options iwlwifi bt_coex_active=N # power_save=y 11n_disable=8
# iwlwifi will dyamically load either iwldvm or iwlmvm depending on the
# microcode file installed on the system. When removing iwlwifi, first
# remove the iwl?vm module and then iwlwifi.
remove iwlwifi \
(/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs /sbin/rmmod) \
&& /sbin/modprobe -r mac80211
Wednesday, July 5, 2017
SSD, Linux and /proc/sys/vm/vfs_cache_pressure
In pretty much every "here is what you should do to optimize Linux in your flash new SSD" guide you can find someone comes with something like this:
"You should tune /proc/sys/vm/vfs_cache_pressure and lower from the default 100 to 50 or something" (and btw setting vm.vfs_cache_pressure = 50 in /etc/sysctl.conf is fastest permanent way of doing that).
It seems like everyone took the copy-and-past route on the first guy who wrote those lines.
I beg to differ.
The thing is: if you can afford the ram and you have a slow (rotionary disk), it makes every sense in the world to significantly lower vfs_cache_pressure because on doing so you're telling the kernel that it should prefer to discard other caches before vfs when there's memory pressure. Otherwise, something simple as a find | xargs grep (or the simply the find itself) can take huge amount of time to traverse directories, etc.
But if you have a 500 Mb/s SSD disk with outstanding random-access times, it's less so. Remember, every other knob remaining on it's defaults, the caches are only flushed when there's ram pressure. And although ram is way faster than ssd, you could be trading a lot of it for a best-case of milliseconds over microseconds, while on the rotational case the relationship is more of seconds for milliseconds and so more perceivable.
On most workloads, you can still benefit from lowering vfs_cache_pressure a bit (say to 90 from it's original 100), but don't go as far as you would with a conventional hard drive for there's little point in doing so. Unless copying huge files/directories around is your work and you have the ram for it, then by all means go for it.
Everyone else should benchmark it before taking for granted. You're welcome.
"You should tune /proc/sys/vm/vfs_cache_pressure and lower from the default 100 to 50 or something" (and btw setting vm.vfs_cache_pressure = 50 in /etc/sysctl.conf is fastest permanent way of doing that).
It seems like everyone took the copy-and-past route on the first guy who wrote those lines.
I beg to differ.
The thing is: if you can afford the ram and you have a slow (rotionary disk), it makes every sense in the world to significantly lower vfs_cache_pressure because on doing so you're telling the kernel that it should prefer to discard other caches before vfs when there's memory pressure. Otherwise, something simple as a find | xargs grep (or the simply the find itself) can take huge amount of time to traverse directories, etc.
But if you have a 500 Mb/s SSD disk with outstanding random-access times, it's less so. Remember, every other knob remaining on it's defaults, the caches are only flushed when there's ram pressure. And although ram is way faster than ssd, you could be trading a lot of it for a best-case of milliseconds over microseconds, while on the rotational case the relationship is more of seconds for milliseconds and so more perceivable.
On most workloads, you can still benefit from lowering vfs_cache_pressure a bit (say to 90 from it's original 100), but don't go as far as you would with a conventional hard drive for there's little point in doing so. Unless copying huge files/directories around is your work and you have the ram for it, then by all means go for it.
Everyone else should benchmark it before taking for granted. You're welcome.
Saturday, August 2, 2014
The Future of Java on the Browser
In the 90's, Netscape Navigator was the best internet browser available. Back then, the web was a newborn technology and pretty much limited to static content, which was mainly images and text.
Things changed as Netscape incorporated support for Sun's Java, and JavaScript. I suspect Java would either not have it's widespread of today, or it would have been happened in quite a slower fashion, should Netscape decided against it.
Javascript allowed for client-side dynamic behavior, and Java Applets complemented it by bringing in primitive multimedia support and new client-server UI design paradigms, limited only by the fact that to the computer-power of the time, java was too heavy and non-performant.
As the browser would progress to become the de-facto standard for most internet services, new standards have developed to allow for more possibilities: Adobe's flash took the leading in the multimedia integration, html evolved, css was created, and typography was taken into account. Jumping ahead in time, we now have html5, which even with it's advanced multimedia capabilities, is still evolving.
All this technology combined now means that the browser has access to:
- Most hardware, including 3D acceleration, microphones, speakers and such;
- Some system level APIs.
In all this time, Java Applets were present, and supported in all major browsers, as an extension, in a great deal to do low-level tasks which couldn't run under the hood of browser's sandbox.
Although Java Applet as a UI element is pretty much deprecated (which doesn't mean there aren't plently of function applications out there), developers have used it as a cross-platform method of computer-station fingerprinting, or to access hardware not exposed by browser's APIs, such as scanners, printers (low-level access), and other forms of client-server data collection.
It works well for such uses, and in some cases is the only way of doing these things in a browser (and/or operating system) independent way.
This is not without limitations: the main way of transferring data from a rich html5 application and a java applet is via LiveConnect, an old bridge which lacks support for many java and javascript evolutions, javascript's strong typed arrays being one of them.
But all of this is in an unknown paradigm-shift border right now: we can either expect java usage in browser to evolve, or, as it's more likely, to fade away completely.
Right now, Google's Chrome is the leading browser and it has faded away NPAPI, the plugin API which allowed java to work, and Oracle (the current Java owner) has not issued any comments on it's interest - or possibly lack of interest - in providing support for google chrome's somewhat-proprietary PPAPI.
Although Mozilla didn't formalized a timeline yet, it also suggested it would drop NPAPI from it's own browser, Firefox.
This leads us with a gap: are we going to see a more tight java integration possibility, bringing Java8 - and it's javascript interesting integration - to the play, or are we ending up with Java being a no-go in the browser scenario?
Time will tell.
Wednesday, May 28, 2014
VLC And DLNA subtitles
If you happen to have an Twonky DLNA media server and you can't get to see the subtitles on videos, try the patch below to VLC. Tested on 2.1.3, 2.1.4 (unreleased). Also applies to git current as of 2014-05-28.
EDIT: This patch was merged to vlc's git!
--- modules/services_discovery/upnp.cpp~ 2013-06-24 15:00:38.000000000 -0300
+++ modules/services_discovery/upnp.cpp 2014-05-28 13:00:25.159999056 -0300
@@ -822,7 +822,8 @@
IXML_Document* p_response = _browseAction( p_parent->getObjectID(),
"BrowseDirectChildren",
"id,dc:title,res," /* Filter */
- "sec:CaptionInfo,sec:CaptionInfoEx",
+ "sec:CaptionInfo,sec:CaptionInfoEx,"
+ "pv:subtitlefile",
psz_starting_index, /* StartingIndex */
"0", /* RequestedCount */
"" /* SortCriteria */
@@ -912,6 +913,10 @@
psz_subtitles = xml_getChildElementValue( itemElement,
"sec:CaptionInfoEx" );
+ if ( !psz_subtitles )
+ psz_subtitles = xml_getChildElementValue( itemElement,
+ "pv:subtitlefile" );
+
/* Try to extract all resources in DIDL */
IXML_NodeList* p_resource_list = ixmlDocument_getElementsByTagName( (IXML_Document*) itemElement, "res" );
if ( p_resource_list )
EDIT: This patch was merged to vlc's git!
--- modules/services_discovery/upnp.cpp~ 2013-06-24 15:00:38.000000000 -0300
+++ modules/services_discovery/upnp.cpp 2014-05-28 13:00:25.159999056 -0300
@@ -822,7 +822,8 @@
IXML_Document* p_response = _browseAction( p_parent->getObjectID(),
"BrowseDirectChildren",
"id,dc:title,res," /* Filter */
- "sec:CaptionInfo,sec:CaptionInfoEx",
+ "sec:CaptionInfo,sec:CaptionInfoEx,"
+ "pv:subtitlefile",
psz_starting_index, /* StartingIndex */
"0", /* RequestedCount */
"" /* SortCriteria */
@@ -912,6 +913,10 @@
psz_subtitles = xml_getChildElementValue( itemElement,
"sec:CaptionInfoEx" );
+ if ( !psz_subtitles )
+ psz_subtitles = xml_getChildElementValue( itemElement,
+ "pv:subtitlefile" );
+
/* Try to extract all resources in DIDL */
IXML_NodeList* p_resource_list = ixmlDocument_getElementsByTagName( (IXML_Document*) itemElement, "res" );
if ( p_resource_list )
Saturday, April 20, 2013
Libreoffice presenter on second monitor
When you configure (a recent) Libreoffice's impress to show on secondary monitor, it should display the presentation on it and the controls (if you have the oracle presenter console, which at least Debian ships by default along openoffice-impress) on the first monitor, right?
Well, if your libreoffice impress window is in the primary monitor, at least for me, the answer is: wrong!
The console shows up on the primary display, but nothing shows on the secondary! If you click reverse (to swap monitor functions), it does what it's supposed to do, but if you click again, the situation repeats!
The "fix" seems to be to drag impress window to secondary display before running the presentation (by pressing F5). Ridiculous, right?
Cheer up!
Well, if your libreoffice impress window is in the primary monitor, at least for me, the answer is: wrong!
The console shows up on the primary display, but nothing shows on the secondary! If you click reverse (to swap monitor functions), it does what it's supposed to do, but if you click again, the situation repeats!
The "fix" seems to be to drag impress window to secondary display before running the presentation (by pressing F5). Ridiculous, right?
Cheer up!
Wednesday, November 28, 2012
Sunday, February 3, 2008
Tuesday, January 29, 2008
Posts
This space for rent. For free, I mean. If you want to post here, or have a site with similar goals (preferably if it provides rss feeds) and you want to link in, please drop me a note.
Saturday, January 26, 2008
LG LE50 Express laptop + Agere Athens AM2 Modem on Linux
This one gave me some trouble, but eventually worked.
The short history:
1) Grab slmodem-2.9.11-20070813.tar.gz (you may try a newer version, and I didn't try with older ones [err, I did, with a very wold 2.9.9 one, and that didn't go very well).
2) Grab this patch (or read the history here).
3) Run slmodemd as this: slmodemd -a -c modem:0
4) Go figure out how to dialout (I used minicom and dialed my phone).
5) Enjoy it!
In the sentence above I use BRAZIL, go figure your country code.
The patch is short so I'll cat it here:
... That was pretty much it, getting here gave me some headache, tough.
I can provide more details if someone needs it.
That was pretty much the last piece of hardware (other than the memory stick reader) left unsupported on linux. Suspend to ram doesn't work for me, but suspend to disk (via uswsusp) is just fine.
Having "noapic" on the command line is a must for this laptop, otherwise sound stops working and it crashes eventually. The open source wireless driver does not work with WPA due to a bug (machine hangs), at least on kernels newer than 2.6.18, but I can use it with aircrack just fine. So I use ndiswrapper for daily-to-daily and the open source one when I need to do cool things like that.
That's it, since I don't use memory sticks, I'm now 100% operational with this old baby.
The short history:
1) Grab slmodem-2.9.11-20070813.tar.gz (you may try a newer version, and I didn't try with older ones [err, I did, with a very wold 2.9.9 one, and that didn't go very well).
2) Grab this patch (or read the history here).
3) Run slmodemd as this: slmodemd -a -c
4) Go figure out how to dialout (I used minicom and dialed my phone).
5) Enjoy it!
In the sentence
The patch is short so I'll cat it here:
diff -rud slmodem-2.9.11-20060727-orig/modem/modem_main.c slmodem-2.9.11-20060727/modem/modem_main.c
--- slmodem-2.9.11-20060727-orig/modem/modem_main.c 2005-09-22 10:05:27.000000000 -0300
+++ slmodem-2.9.11-20060727/modem/modem_main.c 2007-07-10 14:37:33.000000000 -0300
@@ -379,7 +379,7 @@
ERR("cannot set periods for %s: %s\n", stream_name, snd_strerror(err));
return err;
}
- if ( rsize != size ) {
+ if ( rsize < size ) {
ERR("period size %ld is not supported by %s (%ld).\n",
size, stream_name, rsize);
return -1;
... That was pretty much it, getting here gave me some headache, tough.
I can provide more details if someone needs it.
That was pretty much the last piece of hardware (other than the memory stick reader) left unsupported on linux. Suspend to ram doesn't work for me, but suspend to disk (via uswsusp) is just fine.
Having "noapic" on the command line is a must for this laptop, otherwise sound stops working and it crashes eventually. The open source wireless driver does not work with WPA due to a bug (machine hangs), at least on kernels newer than 2.6.18, but I can use it with aircrack just fine. So I use ndiswrapper for daily-to-daily and the open source one when I need to do cool things like that.
That's it, since I don't use memory sticks, I'm now 100% operational with this old baby.
Tuesday, May 22, 2007
Athcool and system crashing
I was using athcool for quite sometime. Then I changed a memory module and things started to crash. If I disabled athcool, things worked just fine.
I was spying on the memory module's SPD info, and noticed it supports self-refreshing. The old one didn't. I then tried to put another memory module aside with this, and things magically works again, even with athcool turned on (it's a must, my processor is an TB athlon xp 2600, it is really warm).
It seems like the BIOS acpi handling fails to put the module in self-refreshing mode, but thinks it has, when entering ACPI C2. In other words, the memory contents seems to get lost. The memory controller seems to correctly refreshes both modules, if at least one of then needs external refreshing.
The mainboard is an ASROCK K7VT2.
I was spying on the memory module's SPD info, and noticed it supports self-refreshing. The old one didn't. I then tried to put another memory module aside with this, and things magically works again, even with athcool turned on (it's a must, my processor is an TB athlon xp 2600, it is really warm).
It seems like the BIOS acpi handling fails to put the module in self-refreshing mode, but thinks it has, when entering ACPI C2. In other words, the memory contents seems to get lost. The memory controller seems to correctly refreshes both modules, if at least one of then needs external refreshing.
The mainboard is an ASROCK K7VT2.
Subscribe to:
Posts (Atom)

