Posts Tagged ‘Linux’

RancidMeat: Mongoose

Tuesday, July 16th, 2013

Mongoose is my new favorite mini web server.

No installer; it’s just a standalone executable. When double-clicked, it hosts the folder it’s in on port 8080.

It lurks in the tray, where you can change its settings with a GUI (generating a mongoose.conf file).
 
 
Some of its features:

  • It can serve perl/php/etc (checking shebang lines and running the appropriate interpreter, if available).
  • When there’s not even an index.html, it can show directory listings.
  • From a commandline, it can create/edit passwords for basic HTTP authentication (htpasswd).
  • It’ll do HTTPS if you’ve got a certificate.
  • As of version 3.8, it lets wget resume downloads (previous versions didn’t understand wget’s request).

 
Article: User Manual on GitHub.
Article: Linux manual, for commandline args.

Windows 8 Breaks NTFS in Linux

Thursday, May 30th, 2013

Warning: A hibernation feature called “Fast Startup” defaults to ON in Windows 8, which leaves the filesystem in an unsafe state every time you shutdown. Based on an assumption that you’ll just boot Windows again next time.

Do not mount NTFS partitions outside of Windows 8 unless that feature is disabled beforehand. For more, see this article.
 
 
Future versions of Linux’s filesystem driver will warn about this and suggest mounting read-only.

Knoppix 7.05 already includes a warning for this, though the nag has a cosmetic bug. It tries to spawn a GUI popup, which fails if you booted straight to a console root prompt.

RancidMeat: The Dude

Friday, November 11th, 2011

screenshot
The Dude network monitor is like a combination of nmap, visio, and nagios to discover / identify network devices, make a graphical image to depict topology, and monitor open ports for service health. It runs under Windows, Linux Wine, and OSX Darwine.
 

 
* It doesn’t by itself plot geographical locations, but you can use a background image of a map and arrange things yourself.

RancidMeat: FreeRapid

Monday, October 31st, 2011

Freshmeat.net has changed its name, so this title’s gonna make less sense. *shrug*

screenshot
Y’know those websites that host files but make you wait and fill out a captcha? FreeRapid is a download manager that knows how to interact with 230+ of em, so you can do more interesting things than stare at a countdown.

It’s mainly for when you’ve got several urls to queue up, but apparently it can save Hulu and YouTube videos too.*

It’s updated relentlessly to keep up with those sites and fetches new plugins each time you start it.
 
 
If you start it with the ” --portable” arg, it’ll keep its config files in its own directory.
 
 
* To set a preferred YouTube video quality, dig through some menus… Options/Preferences/Plugins/youtube.com/options.

Tab-Delimited vs Line-Delimited

Friday, September 16th, 2011

Say you’ve got some text: tab-separated fields with newlines for records… (It’s what you get when you highlight/copy a block of spreadsheet cells, then paste into notepad.)

tabbed.txt:

A b c d
E f g h

 
 
… and you’d like to make it a vertical wall of text instead.

cat tabbed.txt | sed "G" | tr "\t" "\n" > lined.txt

The sed bit adds an extra blank line between records.
 
lined.txt:

A
b
c
d

E
f
g
h
 

 
 
That was easy enough. Now what about the reverse?
 
(more…)

RancidMeat: The Regex Coach

Tuesday, June 28th, 2011

screenshot
If you haven’t dealt much with regular expressions, The Regex Coach is an invaluable learning tool.

Give it a pattern at the top, and in a demo string at the bottom, it highlights the matching segments.

You’ll get waaay more benefit from sed, grep, and string replacement in programming languages once you’ve trained a bit with this.
 
 
When you put this knowledge to use, there will be some variation from environment to environment when it comes to the fancy tricks: basic regex < extended regex < perl regex. Some commands have args to choose which syntax. And depending on quoting, you may need to backslash-escape stuff.

This general regex reference is excellent (nav on the left of that page links to more reference pages, as does the heading of each table).

RancidMeat: GUI diff with WinMerge

Tuesday, June 28th, 2011

screenshot
When you’ve got a couple similar text files and you only want to make a few lines match, the diff command’s not so helpful.

WinMerge is a two-pane GUI that lets you scroll from difference to difference, deciding which blocks one pane should copy from the other. Like the command, WinMerge can also compare directories: altered files among the results can be double-clicked to see what’s inside.

Linux equivalents include Meld, KDiff, and tkdiff. Or running WinMerge Portable under Wine.

Idea: Podcast Speaker Subtitles

Wednesday, April 6th, 2011

When podcasts have 4+ hosts and guests VoIPing, it’d be nice to have a subtitle track that displays the name of the speaker at each moment. Technically nearly doable.

Yes, VLC can show subtitles for audio-only media. Since 0.9.x, you can see them if you turn on visualizations. Alas, no all-black visualization at the moment.*

Video conferencing often has a brady bunch collection of heads with name labels that light up when their mic hears something. Skype and friends could maybe have a script/plugin/eavesdropping-client that logs the times someone speaks, then later converts that to subtitles.
 
(more…)

RancidMeat: Shortcut

Friday, January 28th, 2011

Aside: Linux GUIs have shortcuts too (text .desktop files). A few lines of echo and the google-resistant specs will create one.
 
 
Shortcut is a Windows command to create, edit, or query windows shortcuts (binary .lnk files) from batch scripts.

It handles target, arguments, working dir, normal/minimized/maximized, icon, hotkey, and description. Everything but the Compatibility tab, which I think is an explorer/registry thing, not intrinsic to lnk files.
 
(more…)

Setting Tar Permissions Under Windows

Wednesday, January 19th, 2011

The perk of tarballs is they understand executable permissions, so users don’t have to chmod stuff when they extract.

Creating a tar in Linux/OSX is trivial. Run chmod as desired, and tar preserves everything.

mkdir TopDir
touch TopDir/somefile.txt
chmod 621 TopDir/somefile.txt
tar --create -f "archive.tar" "TopDir"

To see the permissions (aka mode), have tar do a verbose list.

tar -v --list -f "archive.tar"

Brace yourself… Windows makes this difficult.
 
Edit (2011-11-15): Added double quotes around windows wildcard args.
 
(more…)