add script to “open with” in nautilus context menu

http://askubuntu.com/questions/71359/where-is-open-with-in-nautilus

You can create a .desktop file that will be listed on ‘Open with other application’ tab:

Navigate to ~/.local/share/applications
Create a file called textfig.desktop with these contents:

[Desktop Entry]
Encoding=UTF-8
Name=Textfig
Comment=Edit fig files using custom textfig script
Exec= %u
Terminal=true
Type=Application
Icon=
Categories=Application;Utility;TextEditor;
StartupNotify=true
MimeType=text/plain;
NoDisplay=true

After this you will see Textfig in your Open with other application tab, select it and when you double click the file you will be able to open it using your program.

Just adjust the rest of the values a bit more to fit your needs. The %u will tell nautilus to execute it on the currently selected file.

blocking video ads

i can’t stand intrusive video ads. i can understand hulu, where you watch a couple minutes of ads for a full episode. i just mute it and do something else until it’s over. but the ads for the videos on nba’s site are a different story. many of the highlights are less than 30 seconds, but there’s a 15-30 second ad in between each video. that’s just unacceptable.

since switching from firefox (which i thought i would never do, but it was getting way too slow… speed > security) to iron, i’ve kind of given up on adblocking (adblock plus was a lot better in firefox, element blocking does not work well or at all at times in iron/chrome). sorry for the side story, but i’m basically saying that for the most part, i’ve been able to put up with all kinds of ads (whereas i used to add a rule for every ad that i saw).

now back to the videos, i had enough of the nba video ads. i had to do something about it. by the way, if someone knows how to do this on adblock plus (for chromium), let me know. anyhow i have two verified methods a verified method to do this.

using the “inspect element” tool in iron (or chrome or chromium) to monitor network resources, you can see that all the ads are hosted on:
bea4.v.fwmrm.net/ad/

method #1: if you want to use windows firewall (probably the easier method if you already have it enabled). open command prompt and ping “bea4.v.fwmrm.net” (you can only ping domains). you should get something like this:

pinging g1.v.fwmrm.net [63.251.28.128] with 32 bytes of data:
reply from 63.251.28.128: bytes=32 time=22ms ttl=244
reply from 63.251.28.128: bytes=32 time=22ms ttl=244
reply from 63.251.28.128: bytes=32 time=23ms ttl=244
reply from 63.251.28.128: bytes=32 time=24ms ttl=244

notice how it changed the domain to “g1.v.fwmrm.net” instead of what you originally typed in. i guess that’s the real domain name it resolves to. if this domain hosts anything other than ads, then this method is bad because we’ll be blocking more than we want. if it doesn’t or the things it blocks doesn’t matter to you, then all is well! anyhow, we had to do this because the firewall can only block ip addresses not web domains. copy the ip address (right-click > select all > highlight the ip address > right-click) and open windows firewall advanced settings (control panel > [system and security] > windows firewall > advanced settings). create a new outbound rule to block all connections from the ip address you copied (the ip address goes into the remote ip address section under the scope menu). test via ping and you should get back “general failure.” then test via nba videos and you should no longer get any ads, if all goes well.

method #2: after typing all the above, i’m starting to wonder if it really was the “easier” method or not. update: it turns out this is the better method, because of simplicity and ability to deal with multiple ip addresses. if you don’t know about the windows hosts file, it “contains the mappings of ip addresses to host names”. it was how i used to block ads (technically, only ad servers, which failed when sites would house the ads on their own servers) in the old days before ads got “smart” (or “annoying”). it’s the oldest trick in the book: we will map any site we do not want to see to 127.0.0.1, which is your computer, the “localhost”. this causes the computer to search your computer for the ads, which should fail (unless you are a freak running an ad server locally with all the same settings) and return nothing. the hosts file is located in c:\windows\system32\drivers\etc (the same location for xp, 7, and i assume vista). here’s the problem: if you are running windows 7 (or probably vista), you will have to inherit permissions to your user (right-click on hosts file > properties > security > advanced security settings > owner > change owner to: your username > allow full control to your user if it is not already set). now open it in notepad or your favorite text editor. add a line with the following:

127.0.0.1       bea4.v.fwmrm.net

and save it (like ping, hosts can only handle domains). if you have correctly set the permissions, you should have no problems saving the file. on xp, i remember having to restart the system (did i waste my time?), but apparently you don’t have to on 7. test via ping and nba videos.

pinging bea4.v.fwmrm.net [127.0.0.1] with 32 bytes of data:
reply from 127.0.0.1: bytes=32 time<1ms ttl=128
reply from 127.0.0.1: bytes=32 time<1ms ttl=128
reply from 127.0.0.1: bytes=32 time<1ms ttl=128
reply from 127.0.0.1: bytes=32 time<1ms ttl=128

this means the hosts file is working correctly. see how it points to localhost (127.0.0.1) and takes less than 1 ms.

beware of this method. i only mentioned nba videos, because that’s what i used it for and can verify that it works perfectly. the ads are hosted on that server, but the actual videos are hosted on the turner domain. if you tried this with youtube or similar sites, you’d probably end up blocking the video content you want to watch as well. also note that the ip method is useless for sites with dynamic domain ranges. that is why i have deleted it since originally writing this article.

sony vaio vgn-cr220e: problems upgrading to windows 7

windows 7 detected and automatically installed drivers for every component except for two: the texas instruments pcixx12 integrated flashmedia controller, and something else that installed the drivers once i connected to the internet

note: the sony support site might have drivers which offer more functionality than a generic one employed by windows 7 (e.g. touchpad features such as side-scrolling, laptop media buttons, etc.)

you can download tidmsc-13254300-us.exe if you do not believe me, but they are specifically for vista. i could not get them to work for windows 7, even after enabling compatibility mode with vista.

after reading some forums and digging through mostly useless advice (no offense), i finally stumbled upon the “correct” drivers from gateway. installing them through the device manager worked perfectly.

finding duplicate files

i just used smart duplicate finder (i believe it’s named “simple duplicate finder” in the program itself) to delete some duplicate files. seemed to work okay.

antivirus-free system

all of my windows systems are completely free of antivirus software.

there are two major creations that make this possible. virustotal and sandboxie. i also use the help of winmd5sum portable.

i do not check every single file i download. i leave that to inefficient antivirus software. i use winmd5sum to quickly obtain the md5 sums of files that could infect my system (.exe, .dll, et cetera). i then go to the virustotal search page (linked above) and look up the md5 sum. the majority of files i check have already been scanned, which will bring you quickly to a page of results for that file. in the rare event that the file has not been scanned before, return to the homepage of virustotal to upload the file.

in the event of a surefire virus (for example, 40/42 engines detect a virus), i will most likely delete the file. if the file is clean or i am still curious enough to use the infected file, i will run it in sandboxie. this effectively contains the effects of the virus to the virtual system and leaves my physical system untouched. if internet access is allowed within the sandbox, some effects might linger until the programs within the sandbox are terminated. (side note: even for the clean files, the sandbox helps me determine if the program writes to registry or does anything it’s not supposed to.)

not all programs work properly in a sandbox. if i am paranoid enough, i will run those on a virtual machine or test machine (last resort). once programs have been tested enough and i gain trust in the developer, i will allow them to be directly run on my machine.

it might sound like a long and complicated process, but at least for me, this write-up takes up more time than actually doing all of the things i mentioned. oh, and i have also only once in the past several years had to handle a virus problem (by reformatting) and it was because i did not follow my own protocol.

there are some alternate tools that can work just as well as if not better than the ones i have mentioned. it’s all up to preference. here are some of them:
virscan
virtualbox

change capitalization in word processors and text editors

the option can be easily found in libreoffice’s menu, i found it in a couple of seconds.

the same cannot be said about microsoft word and its semi-stupid ribbon interface.

it seems i have spoken too soon, it turns out that there’s a “change case” option with many more capitalization modes in the font area of the home ribbon. (i still think the ribbon interface is kind of dumb!) i have only tested on 2010, but i assume it works in 2007 as well.

the hotkey combination of shift+f3 also works if you are satisfied with uppercase, lowercase, or sentence case (the one that only capitalizes the first letter of the sentence). i can only confirm this working in 2003+, though it might also work in previous versions

i know this feature is available in notepad++ as well, and even lighter text editors might support that option.

Follow

Get every new post delivered to your Inbox.