You are here

Tip

sed: Deleting all lines between two types of lines

Submitted by Druss on Sat, 2012-01-28 01:17

Today, I made quite an impression on my furniture thanks to incessant contact between it and my illustrious head. This, as usual, was due to my looking for a clean regex to solve my issue while working with text files in Vim. My task was, I initially believed, quite simple: delete all the lines that are sandwiched between two types/patterns of lines. In this case, the top slice of the sandwich consisted of a line which was entirely a number and the bottom slice was a line entirely populated with underscores.

Resolving merge conflicts fixed manually in Eclipse/eGit

Submitted by Druss on Tue, 2012-01-03 23:03

I'm using Eclipse (Indigo) and eGit, its Git plugin. Earlier today, when I merged the contents of one branch with my master, I ran into a bunch of conflicts. While I suspect that I should have used the "Team > Merge Tool" to resolve them, as they were rudimentary in nature, I just sorted them out manually. However, eGit did not notice that the conflicts (and their in-file markers) were gone and retained the conflicted icon for each of the affected files.

KDE network manager disabled

Submitted by Druss on Sat, 2011-12-31 15:45

One of my laptops which is running on Kubuntu Lucid decided to stop connecting to my network today. I found that the KDE network-manager applet (or is it a plasmoid? :S) had decided to disable itself. Clicking it stated so with no option to re-enable it (nice UI, boys). Getting to the commandline and starting the network-manager service did not help. I also found that accessing the System settings networking configuration gave me corrupt XML file errors.

Missing Excel/XLS/XLSX spreadsheet import in PHPMyAdmin

Submitted by Druss on Fri, 2011-12-09 14:26

If you find that the really handy Excel spreadsheet import feature for MySQL is missing in PHPMyAdmin, it's because it has been removed. According to the PHPMyAdmin changelog:

3.4.5.0 (2011-09-14)
- [core] Remove library PHPExcel, due to license issues
- [export] Remove native Excel export modules (xls and xlsx formats)
- [import] Remove native Excel import modules (xls and xlsx formats)

PHPMyAdmin xls/ods import fails or hangs when partially complete

Submitted by Druss on Wed, 2011-12-07 01:56

If you're importing Open Office / Libre Office Calc files or Excel spreadsheets into MySQL using PHPMyAdmin, you might have run into the occasional case where the process hangs with either a partially imported set or no records at all. After some messing around, I have found that this usually happens when there's a problem with the input data. In my case, this usually stemmed from duplicate primary keys or similar issues. Unique keys were detected fine.

In other words, PEBKAC.

Removing hyperlinks from Open Office Calc

Submitted by Druss on Sat, 2011-11-26 20:46

If you have ever pasted data into Calc in Open Office, you'll notice that any hyperlinks in the input data will be retained as hyperlinks rather than reduced to plain text. While this might be beneficial behaviour to some, it wasn't for me this afternoon. After a little digging around, I found that an easy way of removing the hyperlinks is by highlighting all the affected cells, right-clicking and choosing the Default Formatting option.

The associated CTRL + M shortcut (as seen in the Format menu) did not work for me.

Error message: iptables-restore v1.x.x: no command specified

Submitted by Druss on Thu, 2011-11-24 12:29

If you run into the following error message when attempting an iptables-restore < my.rules:
iptables-restore v1.4.8: no command specified
then the problem is that you have very likely just copied and pasted stuff into my.rules which has led to some dodgy line-breaks terminating blank lines in the file.

Apache/httpd error: SoftException in Application.cpp:357: UID of script "/home/foo/public_html/index.php" is smaller than min_uid

Submitted by Druss on Fri, 2011-11-11 20:13

On a server I am working on right now, I installed a PHP application and attempted to run it. However, I ran into a "500 Internal Server Error". Upon further investigation by checking the logs, I found the following errors in the Apache error log:

Pages

Subscribe to RSS - Tip