Cross-platform Notes

  • Ruby - IO IO operations should be done within begin-rescue blocks. Reading contents = IO.read(portname) # The entire file will be read into memory as its contents is retrieved. Read closes after use. contents = File.read(portname) # Same as above (File is ...
  • MongoDB notes - MongoDB is a NoSQL database. Journal size MongoDB will create journal files, by default on 64 bit systems, rotating when they hit 1G in size. Apparently it will only create a max of 3G worth of journal files. On my computer (Gentoo Linux) they’re sto...
  • How to print landscape in Open Office oocalc - Open Office version 2.3.1 It's not immediately obvious how to print in landscape mode in Open Office spreadsheet (oocalc). Here's how... Do a page preview. File -> Page Preview. Click the Format Page tab. Click the Page tab. Select landscape o...
  • Copy a VMware Server virtual machine - In VMware Server, you can only ever have a SINGLE snapshot of a VM. You click the "take snapshot" button and it will overwrite the old one. However, it turns out that you can easily copy VMs. Simply copy the folder to a different location. Open the V...
  • Grouping / concatenating / aggregating MySQL fields / column values - Given the test database from MySQL many-to-many join test and the following query: mysql> select posts.*, categories.* from posts_categories join posts on posts_categories.post_id = posts.post_id join categories on posts_categories.category_id = ca...
  • Generate Javadoc - Javadoc pre v1.4. Notes may be applicable to later versions, but untested. Oddities Commands Resources Oddities | Go to top First, some oddities: In your Javadoc comments you must not have a * before an @ (that precedes a Javadoc tag)...
  • How to enable remote login to Thomson Technicolor router - To enable remote login / access via the WAN external IP on a Thomson Technicolor TG582n router, do the following: Log in to the router at https://192.168.1.254. Go to Toolbox -> Remote Assistance. Select ‘permanent’ (as opposed to ‘temporary...
  • Thunderbird notes - Notes about the Thunderbird email client. Index Change to ‘Body Text’ default Keeping folder stucture in archive 404 caching Thunderbird email encryption with Avast Antivirus Remote images Hide remote content Syncing Google Contacts A...
  • How to bring back Firefox's "remember the password?" prompt. - With Firefox (24.4.0) if you visit a site with basic authentication you’ll get a popup asking for your username and password. When you’ve supplied it then Firefox will prompt ‘Would you like to remember the password for [site name]?’. If you select th...
  • Ant - Some potentially useful resources: Subversion revision control system." class="weblink">SvnAnt – An ant task that provide an interface to Subversion revision control system. Conditional Compiling – Article about conditional compiling in A...
  • Change DNS on Thompson Technicolor router - I have found Plusnet DNS servers to be unreliable, possibly because my router was set to use those they now specify as fallback IPs, so I needed to change the DNS used by the Thompson Technicolor TG582n router that was provided. I couldn’t find a way ...
  • iTunes notes - Notes about iTunes. Maximise the window On OSX, the green maximise button can sometimes switch iTunes to mini player view instead of maximising it, depending on the version of iTunes. To maximise, use the following key combination: Cmd-Ctrl-z Th...
  • Email encryption with Thunderbird - Set up Thunderbird 3.0.3 OpenPGP (Enigmail 1.0.1). Create keys OpenPGP -> Key Management. Select ‘Display All Keys By Default’. Generate -> New Key Pair. Select account. Tick ‘No passphrase’. Remove comment (as it’ll be available ...
  • How to write a MySQL table to a CSV file - To write the users table to /tmp/users.csv: SELECT * INTO OUTFILE '/tmp/users.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n' FROM users Source: Export data to CSV from MySQL
  • Gmail ignores dots in username - Gmail doesn’t recognize dots as characters within usernames, you can add or remove the dots from a Gmail address without changing the actual destination address; they’ll all go to your inbox, and only yours. From Receiving someone else’s mail - Gmail ...
  • How to add Google Translate as Firefox search keyword - Firefox has a great feature that allows you to right click on a search box (form text field) and select “Add a Keyword for this Search” to associate a keyword with the search via a special bookmark. From then on you can run the search by entering the k...
  • GIMP notes - Notes about the GIMP graphics editor. Index Draw a straight line Copy layer to be a layer mask Draw an arrow Change one colour gradient for another Create a distressed background effect Gotchas Draw a straight line Hold down shift when...
  • MySQL many-to-many join test - MySQL 5.1.56. Setup: create database join_test; connect join_test; create table posts (post_id int not null auto_increment, name varchar(100), primary key (post_id)); create table categories (category_id int not null auto_increment, name varchar(100)...
  • Computational complexity examples - Here are some nice examples of computation complexities, lifted from Examples of Algorithms which has O(1), O(n log n) and O(log n) complexities… More examples here: Orders of common functions Constant: O(1) time Accessing Array Index (int a = AR...
  • Lyx and Latex notes - Latex is a document preparation system, commonly used for creating PDF files. Lyx is a document processor, which is basically a GUI for Latex, with enhancements. These notes have been tested with Lyx version 1.5.4. Index Resize editor text Instal...
  • Asterix in Firefox tab - If you find an asterix (*) in a Firefox tab then chances are you’ve got Tab Mix Plus installed and you accidentally selected the tab. You can select/unselect a tab with ctrl-left-click. References: Firefox asterisk in tab
  • Auto resizing multiple cells in LibreOffice spreadsheet - When I export a Google Docs spreadsheet into OpenDocument format, it will open in LibreOffice calc with the height of each cell wildly different. No idea why. It seems people can get the same problem when pasting content into a LibreOffice spreadsheet....
  • How to search discussions on google - Google search used to have an option to filter by discussions i.e. forums and other sites where people are discussing something. This was very useful for finding opinion on e.g. whether a particular web shop is reliable. Google seem to have removed th...
  • Converting MySQL tables from MyISAM to InnoDB - For MySQL 4.1, to convert the MyISAM tables to InnoDB (for transaction support and more), you have to... Edit the SQL so that the foreign keys are indexed Make sure that any tables containing a referenced column are created before the tables which ...
  • HP Officejet J6410 printer - Printer settings Ethernet I needed to set the following printer configuration in order for the printer to work on my network via gentoo (via cups/hplip). They proved fine for a Windows XP box too. IP: Automatic. Link speed: 10-Full. If having probl...
  • LibreOffice calc / oocalc notes - Notes about oocalc. Regex find You can use regular expressions only if you tick ‘Regular expressions’ in the ‘Other options’ section of the Find & Replace dialog, accessed via Edit -> Find & Replace… Reference: List of Regular Expressions...
  • Bad usability in the 21st Century - This is a rant. Why?.. Because it calms me. I’ve been computing now for the majority of my life and usability & accessibility problems have always annoyed me. Like any reasonable person I assumed that as the technologies develop they would become ...
  • Problems with hyphens in MySQL. - MySQL does not handle hyphens very well. For example, I created a database called "modx-test" and then tried to delete it, which failed due to a syntax error: mysql> drop database modx-test; ERROR 1064 (42000): You have an error in your SQL syntax; ch...
  • Buffalo LinkStation LS-LGL - Note on the Buffalo LinkStation LS-LGL NAS. How to turn off The power switch is a little black button at the back of the device near the top. To turn off the NAS, hold down the power button for 3 seconds. You should see the power light start to flash...
  • Chrome notes - Notes about Google Chrome. Disable swipe reload Chrome will now refresh the page if you drag your finger down the screen, which I find annoying because it does it when I try to wipe of a smudge! To disable the so-called “pull to refresh” do the follo...
  • Permanently remove Mozilla Firebird extension - The following was taken from a posting on the Mozillazine forums by laszlo. Posted: Wed 8th Jan 2003 4:23pm How to uninstall an extension Until the uninstall feature for extensions is implemented (bug 170006), use this procedure as...
  • How to close a section in LibreOffice / OpenOffice - You can define sections in a LibreOffice / OpenOffice / odt document to format parts of a document differently, if e.g. you want one part to have multiple columns. Alt-Enter will close a section. Yet again it took an age to figure out - I couldn’t fi...
  • Acer TravelMate 8104WLMi battery details - This page documents details of the replacement battery required by an Acer Travelmate 8104WLMi laptop, which is from their 8100 range. Serial number: BT.00803.006 The actual number on the battery doesn’t have the dots and has more digits, but I was t...
  • Regular Expressions - The following was nicked from Zhou Chen :: Regular Expression, which in turn was nicked from Regular Expressions by Ashley J.S Mills. Regular Expressions Introduction You have probably used regular expressions before, for instance if you ...
  • How to clean a trackball - The following was lifted from a Customer Reviews Of Microsoft TrackBall Optical Black Mouse. I've tried it and it works. PROBLEM: You've just cleaned the ball and bearings, and now it feels weirdly reluctant to move with your thumb, as though it's de...
  • Create charts / graphs in OpenOffice oocalc - Aim: Count occurrences of words in a column and create a pie chart from it. The column that you'd like to chart should have a title in its first cell. Select the column. Data -> DataPilot -> Start. Use current selection. Window will pop up t...
  • How to save a copy of a file cached by Firefox - Firefox caches files from a web page, presumably saved somewhere in the .mozilla/firefox/[profile]/Cache/ directory under a random name. It is possible to view information about the cached files and save a copy using a more descriptive name. Go to ab...
  • Firefox caching 404 pages - If Firefox is caching 404 pages, try disabling IPv6: Visit about:config. Double-click network.dns.disableIPv6 to set it to true. Restart firefox.
  • RSI - Repetitive Strain Injury - Some tips for overcoming RSI. Swap hands and input device Periodically swap input device between your right and left hands. Also, I found that changing the type of input device helped a great deal. Periodically swap between a normal mouse, a finger ...
  • How to create different headers in an OpenOffice / LibreOffice / odt document - Summary: Create a unique page style for each header and add them by adding page breaks. Details follow after a brief rant, because I can’t help it. Rant: I hate Microsoft Office and I hate OpenOffice / LibreOffice just as much. Even thinking about the...
  • oowriter variables - To create a variable in oowriter 3.0.0... Normal variables (i.e. single occurrence) A normal variable can be inserted into the document. You double click it to edit its value. Insert -> Field -> Other. Variables tab. Set type to 'Set variable'. ...
  • Google notes - Notes about various Google online products. They’ve gone way downhill in my opinion, from simple and usable to complex and confusing - lots of interacting services sharing data in spurious ways and no decent documentation. I guess that’s what happens w...
  • Jar - To inspect a jar archive use the following command, where file.jar is the jar you want to inspect: jar tf file.jar Listed below is a combination of commands that checks all jar files in the current directory (and all subdirectories) for...
  • MODx - Useful SQL – Useful SQL for use on the MODx database. MODx Links – Useful MODx links. MODx Customisations – Customisations made to the MODx Content Management System for mindspill.net.
  • Tomcat - Customised 404 error page Customised 404 error page | Go to top To customise the 404 "page not found" error page that is displayed by Tomcat, simply add the following to the web.xml file below the closing welcome-file-list tag: ...
  • Eclipse - Notes about Eclipse v3 and related plugins. Index Exception thrown launching help Eclipse with Subclipse or Subversion Exception thrown launching help | Go to top Try configuring a default browser. Go to Window -> Preferences ->H...
  • How to preserve folders in thunderbird archives - To have Thunderbird preserve your folder structure when archiving emails, e.g. if you have filters set up to move messages into separate inbox folders, then you’ll need to make a manual change to the Thunderbird config. Edit -> Preferences (or Opti...
  • Using Gmail with Thunderbird - I use Thunderbird via POP because I like to have a copy of all email on my computer so I can easily back it up. I also use gmail with other clients (e.g. mobile phone) so I have the following server settings (accessible via Account Settings -> [acc...
  • High-speed Brute-force Password Cracker for MySQL 3 - I took this program from the Securiteam web site. I believe it was posted on their mailing list by someone known as Secret Squirrel. It will crack passwords that have been hashed using the old MySQL 3 password hashing function. I tried it an it works, ...
  • Firefox find as you type problem - There is a well known "bug" in firefox, whereby typing on the keyboard will start the "find as you type" (aka "lookahead find") feature and start searching the web page for whatever you typed. I believe firefox enables this option by default. The fir...
  • Reset Windows Vista password - I recently needed to get into a Windows Vista machine, but I didn’t know the password. Some versions of Windows will allow you to hold F8 on boot, choose Safe Mode, then access Windows via a hidden Administrator account with blank password. Failing th...
  • Adobe Flash local storage default settings - Adobe Flash v10 will present the following message when a site wants to store info on your computer: Adobe Flash Player Settings Local Storage s.ytimg.com is requesting permission to store information on your computer. Requested: up to 10 KB Currentl...
  • How to create a LibreOffice chart with two axes - In LibreOffice 3.5. Create your chart as normal. I’ll assume you’ve created some kind of line graph. Right-click on the chart and select Edit. Right-click and Insert/Delete Axis. Select a secondary Y axis. Now you’ll have two Y axes but they’...
  • A description of i386 i486 i586 i686 - The following was lifted from Best of the Newsgroups: compiler optimizing. --- Begin excerpt --- Jim Kroger <--->, In a message on Mon, 26 May 2003 18:55:29 -0400, wrote : JK> Nobody has yet said what i386 and i686 refer to. J...
  • Acer Travelmate 8100 series technical specifications - This is a copy of the spec that used to be on Acer’s web site. It’s gone now, but I did find this on their support site: TravelMate 8100 Series Specifications. Operating System Microsoft Windows XP Professional (SP2) Processor and chipset Mo...
  • Creating a bibliography in LyX using BibTeX - This article describes how to create a bibliography in LyX 1.4.1 using BibTeX. Add the following preamble to wrap long urls and use the natbib style with numbered citations. Document -> Settings... -> LaTeX Preamble. \usepackage {url} \usep...
  • Chrome extensions - Notes about Chrome extensions. Privacy aka Forget About Privacy Most useful extensions can view the contents of every web page you visit. That is READ THE CONTENTS OF EVERY WEB PAGE YOU VISIT. I’m not sure people realise how significant this is. In ...
  • Google Sheets notes - Notes on Google Sheets online spreadsheet. Index Usage Referencing sheets List of items Conditional sum Complex conditional sum Import data from another spreadsheet Bugs Not interpreting formu...
  • Java Collections - This page refers to Lists, Sets and Maps in the Java 2 platform. Their class hierarchy relative to the top level interfaces are as follows: The table below was nicked from a JavaWorld.com article called Get started with the Java...
  • Audio formats - See What’s the difference between WAV, AIFF, AIF, MP3, FLAC, WMA, ALAC, M4A etc …? ISO Raw data. CDDA - Compact Disc Digital Audio CDDA (A.K.A. Red Book standard) defines audio CDs. Its audio format uses LPCM (Linear Pulse Code Modulation). WAVE -...
  • MySQL - Index User admin Grant Revoke Backing up Locate configuration files Max allowed packet error MyISAM to InnoDB Check a database for errors and repair tables Multiple access details in my.cnf User admin The foll...
  • The decline of Google Search - I have noticed Google Search (at google.com) go downhill in the last couple of years. I think they’re dumbing it down for a general audience, which is massively pointless as a general audience wouldn’t use the “power” operators anyway. It is no longer ...
  • CSS width on inline vs block level elements - div#test_width_div_243 { border: 1px solid black; width: 20em; } span#test_width_span_243 { border: 1px solid black; width: 20em; } Below is an example of an inline element - the span - and a block level element - the div. Both been styled with CS...
  • Facebook photo album privacy - Facebook is a privacy nightmare. Here’s one problem I found regarding the creation of photo albums, which is largely due to their use of language: When creating a photo album (after uploading photos) and editing it (when editing the photos in an album...
  • Problem dropping MySQL user - MySQL 4.1.14. If you can not drop a user because you get the following error: mysql> drop user 'username'@'domain'; ERROR 1268 (HY000): Can't drop one or more of the requested users Revoke all privileges first: mysql> REVOKE ALL PRIVILEGES FROM...
  • Remember The Milk notes - This page documents my notes on Remember The Milk{.weblink} - a great task manager / todo list, particularly because of its powerful search capabilities. Oddity searching by date for tasks with a time If you search for tasks that have been given a ti...
  • Prevent password prompt when starting Apache's SSL - When OpenSSL is first configured it is normal to encrypt the SSL encryption key. This means that when the SSL is started a password is required so that the key can be decrypted. To prevent this happening you simply store the key unencrypted. Obviously ...
  • Hotmail notes - Notes about Hotmail. Send from another address Go to ‘Options -> (More Options ->) Sending/receiving e-mail from other accounts’ and ‘Add another account to send mail from’. After verifying the address (by following the link they’ll email to t...
  • libreoffice calc / oocalc pie charts - Count occurrences of words in a column and create a pie chart from it The column should have the title in its first cell e.g Animals: Animals Cat Dog Cat Select the col...
  • How to prevent Chrome tabs loading until selected - When you start Chrome it will load all tabs - very annoying and resource intensive if you’ve got lots of them. To prevent this, install the FooTab extension. You’ll have to do this manually: Download FooTab from http://sourceforge.net/projects/foo...
  • CUPS client-error-document-format-not-supported - The setup You have a printer connected to a linux box and managed using CUPS. You are accessing the printer from Windows (XP) via IPP using http://[printserver]:631/printers/[printername]. The problem Printing fails from Windows, with the follo...
  • Lisp (SBCL) notes - Command history In Linux, if you want to have command history when in the REPL, e.g. the use of up/down to scroll between previously entered expressions, then you can launch sbcl via rlwrap. Add the following to ~/.bash_aliases: alias lisp='rlwrap sb...
  • Determine which storage type is used by a MySQL table - To determine which storage type (e.g. MyISAM, InnoDB) is being used by a table, use the mysqlshow command: mysqlshow -i -u[username] -p [database] Only use the -u and -p flags if you need to specify a username and enter a password to access the dat...
  • Using Wolfram|Alpha to simplify logical expressions - You can use Wolfram|Alpha to simplify logical expressions, which is particularly handy if you’re a programmer. Take the following contrived expression, in Ruby: if (not ((a < s) or (b > t))) ... This can be converted to the following query i...
  • How to search events in Lightning calendar - To search events in the Thunderbird (10.0.3) Lightning (1.2.b1) calendar extension: Select the calendar tab. Events and Tasks -> Find Events. They should really add a search button next to the tasks icon (top right) as they have with email.
  • Ruby on Rails - How to list rake tasks – How to list the available rake tasks. Generate documentation for all Ruby gems – How to generate documentation for all installed Ruby gems. rake doc:app, rdoc and private methods – How to generate documentatio...

Last modified: 04/06/2007 Tags: (none)

This website is a personal resource. Nothing here is guaranteed correct or complete, so use at your own risk and try not to delete the Internet. -Stephan

Site Info

Privacy policy

Go to top