Why do I feel cold in winter in a room at the same temperature as in summer?

Because of thermal equilibrium — there is more stuff in the room (like the walls) that is colder than you are and so you are loosing heat while the walls are trying to get warmer resulting in you feeling cold. In summer, the walls are warmer and there is less of a temperature difference between objects and so you aren’t loosing heat and so you don’t feel as cold. There is also humidity that contributes into the same thing of establishing thermal equilibrium.

Share

Emacs 24.5.1 update issue on Windows 7

After updating Emacs to 24.5.1 (from 23.2) on my Windows 7 machine, I found that Emacs wouldn’t startup properly and would just display a white/blank screen and appear to hang. When running it from the command line, I was seeing a couple of lines of errors indicating a problem with GTK on startup:

GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init()
GLib-CRITICAL **: g_once_init_leave: assertion `result != 0′ failed

This reminded me that I had installed GTK+ 3.0 recently prior to my update and thought perhaps this was some interaction with the new GTK installation. Rather than uninstall GTK, I opted to remove the path to the GTK bin from my Windows 7 PATH environment variable. Once I did that and then tried to run Emacs, it worked properly. Not sure what the weird interaction was about — perhaps the wrong GTK DLL was being loaded up?

Share

Mac RDP using CoRD to Windows 7 and issues with mouse cursor disappearing

When using CoRD to RDP to a Windows 7 machine from a Macbook Air running OS-X 10.6.8 (Snow Leopard), I was having trouble with the mouse cursor disappearing after starting any email edits with Microsoft Outlook on the remote Windows 7 machine. Turns out this is a Windows feature where the mouse cursor is hidden whenever in a editing window. There are settings in the Mouse control panel to remove this default behavior: Control Panel > Hardware and Sound > Mouse (dialog) > Pointer Options (tab) > “Hide pointer while typing” (checkbox). My problem was that the mouse pointer would disappear and stay disappeared for that session. Turns on there is a setting already to fix this — if you press the “Control” key and then move the mouse, the cursor reappears. Also clicking the mouse button once while still editing brings the cursor back temporarily (until you start editing again).

Share

Firefox and FormData Objects — Gotcha/Issue

When sending over a file using FormData objects and XMLHttpRequest via POST, make sure not to name the file object with the string “file” as in

formData.append(“file”, e.target.files[0]);

Use any other name than “file”, e.g.:

formData.append(“userfile”, e.target.files[0]);

Not sure what happens under the hood, but for some reason with a PHP based server (perhaps the problem was with the framework being used), the POST never occurred until I changed the key string naming.

Share

Windows 7 Wi-Fi slow start issue on startup with VirtualBox

UPDATE:

After repeatedly being exposed to this problem, I think I finally understand what the issue is with this slow-start — mostly conjecture on my part.

On my PC, I don’t have any wired Ethernet connection (I have Ethernet ports, but I haven’t connected them). I rely on the Wi-Fi connection for my Internet access. With the VirtualBox software installed, it installs a virtual Ethernet port on Windows side of things to connect with a Virtual LAN Bridge that networks the VirtualBox virtual machine with the Windows machine. This virtual Ethernet port comes up right away (I assume it is set to be always up) while, I think, the Wi-Fi port probably has some small initial start-up time that it takes to initialize itself. At start-up or wake-up, Windows, I think, then sees only one up network port (the port into the Virtual Bridge) and tries initially to use this port to connect to the Internet and continues to try and retry and finally, after some retries/timeouts,  falls back to using the Wi-Fi port for the Internet connection which by this time has come up.

Unfortunately, I haven’t figured out a clean solution that will allow me to keep both the VirtualBox installation as-is *and* give my Wi-Fi port some priority (or have some sort of Windows networking start up delay that allows the Wi-Fi port some time to initialize itself before Windows tries to start using it).

If anyone with VirtualBox experience knows of some way of tweaking the virtual-port to start-up after a delay, please chime in in the comments.

 

Original Blog Entry:

I had installed Oracle’s (previously Sun’s) VirtualBox software on my Windows 7 machine and subsequently I noticed that every time I started into Windows 7 after waking up from sleep or powering on the PC or rebooting the PC, the WiFi connection would not come up for 1-2 minutes. After a lot of experimentation, I found that un-checking the “VirtualBox Bridged Networking Driver” setting in the “Wireless Network Connection Properties” dialog for my wireless card solved the problem. No more slow-start. Not sure if this results in other problems for VirtualBox, but for now this is good for me. Getting to the dialog is via Control Panel > Network and Internet > Network and Sharing Center  and click on “Change Adapter Settings” on the left-hand side. This brings up the list of adapters and right-click on your wireless adapter and choose “Properties” for the “Wireless Network Connection Properties” for your wireless adapter.

Share

Reduce size of scanned images saved as PDF files

I am new to the phenomenon of scanned documents using a color scanner being very large in size. An 8 page document that was about 105K when originally delivered to me as a PDF file ended up being about 12.5M after I had printed it out, signed my signature and scanned it to a PDF file again.

Looking around the web, it seemed like there were many suggestions on reducing the size of a scanned document. There are software that will compress the size of your scanned PDF file, but nothing free. Ultimately I played around with the settings of my scanner (which is a Canon MP620 Pixma printer/scanner/copier combo) and found that the following settings reduced the size of the scanned image drastically.

The single change that had the biggest impact was to change the scan settings so that the document was scanned as a Black & White image instead of a Color image. Another setting that reduced the size further was to use 150dpi when scanning instead of 300dpi which was set as the default. Finally a big reduction results when you choose high compression when converting to a PDF file. Finally I went with just the Black & White scan setting only (since changing the other settings also reduced the quality of the resulting PDF file) and I was able to get a PDF of about 2M instead of the 12.5M that I was originally getting. So a decent amount of reduction in size.

Share

Fix for garbled WordPress admin screen

IMPORTANT: See update to this below after the image

After logging in, the admin screen (dashboard) of my WordPress installation was all jumbled (see screenshot below). It seemed like a CSS or JavaScript related problem. Developer tools on Google Chrome reported several issues with locating the ‘jQuery‘ variable and with the wp-admin/load-scripts.php file.

After several attempts at searching the WordPress site and googling around, I came across this forum post. Based on this forum post, I found that first configuring define(‘SCRIPT_DEBUG’, true); in wp-config.php and then refreshing my admin screen fixed the problem. Subsequently I removed this config line and refreshed my admin screen again and it stayed fixed.

It seems like in the default configuration, WordPress compresses or combines several JavaScript and/or CSS files into a single file and this compression/combination was somehow garbled. Turning on the SCRIPT_DEBUG flag turned off this compression and removing it again probably re-generated some files fixing my problem — I don’t know for sure what actually helped! But it worked.

This was with WordPress 3.3.1.

Fix for WordPress Admin Screen Garbled/Jumbled
WordPress Admin Screen Garbled

UPDATE:

This happened a second time to me and doing the same thing as described above fixed the problem once again. But in the process, I noticed that the time-stamps on all files in my blog directory had been somehow updated to today’s date. Also *every* PHP file now had some additional code at the top within a php tag in the first line. The php code was eval‘ing a base64_encoded string via the base64_encode api. Apparently, evaluating this encoded string injected some JavaScript into every php based page on the site. It looked like some mal-ware had taken over my site. Having sucuri.net evaluate my site indicated there was some mal-ware (you provide your URL and they crawl your site and tell you whether your site has any mal-ware injected).

To fix my problem, I used the following shell scripts to detect files having the problem and to fix them.

Remember that I provide these scripts as an aid to anyone encountering the same problem and provide them as-is without any warranty. USE THEM AT YOUR OWN RISK. PLEASE MAKE BACKUPS OF YOUR FILES BEFORE RUNNING THESE SCRIPTS SINCE THEY WILL MODIFY FILES. The regular expression I used worked for me, but they may not necessarily work for you. BACKUP, BACKUP, BACKUP. Also the below may not be sufficient to rid your site of this mal-ware. I don’t know what else needs be done to completely rid your blog of the mal-ware.

To find all the files with this injected php code, I used the following script:

find . -name “*.php” | xargs awk ‘FNR == 1 && /<?php.*base64_.*?>/ {print FILENAME}{nextfile}’

To remove this line of injected php code, I used the following script:

find . -name “*.php” | xargs sed -i ‘1s/<?php \/\*\*\/ .val(base64.decode(“.*==”));?>//’

(In the above scripts, please fix the quotes and the double-quotes — pre-formatted code doesn’t wrap, so had to use regular formatting which messes with quotes and such)

Now I wait and watch to see if the problem re-surfaces, if it does, then I know there is more I need to do.

UPDATE:

This happened yet another time and I cleaned up in the same manner. I also searched some more and found that someone had installed the infamous c99 shell to allow them backdoor access into my setup. They were using this backdoor access to periodically inject additional php code into my php scripts. I found the c99 shell by searching for the string “gzdef.ate.base.._encode” (I am using . instead of the actual character to prevent security tools from thinking this page has a security issue. Replace the dots with ‘l’, ‘6’ and ‘4’ in order). I removed the backdoor, but I am yet to find the vulnerability in the existing script that was exploited by someone to install the backdoor shell in the first place. Looking…

Share