March 8, 2010

Print Preview has long been one of my favourite browser buttons. I don't actually print much, but it is a way of blocking all the winkin' and blinkin' content that some websites indulge in to excess. I don't object to advertising per se, but I do object to moving ads that constantly vie for my attention. It's like TV sets in bars. OK, the sound's off and it's only a soap opera, but you can't help being distracted by the constant movement.

On my personal machines I use AdBlock Plus, a Firefox add-on that does just what it claims. Flashblock is good too, replacing Flash animations with a Play button so you have the option of whether to run them or not. But I recently discovered Readability, a handy bookmarklet from Arc90 that strips the garbage at the press of a button and presents you with a nicely formatted page.



Readability turns this ...



... into this.


Installation's a doddle. Select your preferred style, size and margin settings on the Readability homepage then drag and drop the Readability button to your toolbar. Whenever you want to make a page more readable, just click the button.

According to the site "Readability works with most major modern browsers and has been tested on many news sites and blogs. It isn’t 100% effective but works surprisingly well."

It does too. Readers' rule!

Follow Geoff Palmer on Twitter

February 28, 2010

The basic syntax of the find command is simple:

find [where-to-look] [search-criteria] [what-to-do]

All parameters are optional (that's what those square brackets mean), and the defaults are:
find . (current directory), blank (show all files) and -print (display to the screen), so the command find
on its own will display the pathnames of all files in the current directory and all its subdirectories.

Basic searches

find -name myfile
Case-sensitive search for all files named "myfile" in the current directory or any of its subdirectories.

find -iname myfile
Case-insensitive search for all files named "myfile" in the current directory or any of its subdirectories. (This will also pick up files with names like "Myfile", "MYFILE" and "MyFiLe".)

find ~ -name my*
Find all files in the user's /home directory beginning with "my".

find ~ -name *file
Find all files in the user's /home directory ending in "file".

find -name "[0-9]*"
Find all files and directories starting with a number.

find -type d -name "[0-9]*"
Find only directories starting with a number.

find -type d -name "[a-c]*"
Find only directories beginning with the letters a, b or c (lowercase).


Controlling depth

By default find searches all subdirectories too. But you can control that with -maxdepth.

find . -maxdepth 1 -name myfile
Only search the current directory for files named "myfile".


Property searches

Find doesn't just work on file names!

find ~ -user fred
Find all files in /home directory owned by user fred.

find ~ -size +750k
Find all files in the /home directory larger then 7500k.

find ~ -size +500k -size -750k
Find all files in the /home directory larger then 500k but less than 750k.

find ~ -size +100M
Find all files in the /home directory greater than 100M.


Finding by time

-mtime is a measure of 24-hour periods, so ...

find -mtime 0
Finds all files that were modified in the last 24 hours.

find -mtime -2
Find all files that are 2 days old or newer.

find -mtime +30
Find all files that were modified more than 30 days ago.


-mmin is a measure of minutes, so ...

find -mmin -10
Finds all files that were modified less than 10 minutes ago.

find -mmin +5 -mmin -10
Find all files modified between 6 and 9 minutes ago.


Executing commands

If find returns a match, -exec command will execute command.

find -iname my* -type f -exec ls -lah '{}' \;
Find and list all files beginning with "my" (case insensitive).

find -size +500k -size -1000k -exec ls -lah '{}' \;
Find and list all files larger then 500k but less than 1,000k.

find -iname my* -exec file '{}' \;
Find all files beginning with "my" and display their file types.

find -iname my* -exec md5sum {} \;
Find all files beginning with "my" and display their md5sums.

You can even pipe output to other commands after the -exec ...
find . -type f -exec ls -sah {} \; | sort -n -r | head -10
Find, sort and list the 10 biggest files in the current directory (and its subdirectories).


Permission, owners and groups

You can also search based on permissions, owners or groups.

find -type f -user geoff
Find all files owned by user "geoff".

find -type f -group root
Find all files belonging to group "root".

find . -perm -o=w
Find all files in the current directory that are writeable by others

find . -perm /u=w,g=w
Find all files in the current directory that are writable by either their owner or their group.

find . -perm -g+w,u+w
Find all files in the current directory that are writable by both their owner and their group.

find . -perm -a+r -perm /a+w ! -perm /a+x
Find all files in the current directory that are readable by everybody (-perm -a+r), have at least one write bit set (-perm /a+w) but are not executable by anybody (-perm /a+x).


Tips & Tricks

If you're searching the entire system as an ordinary user, you'll get lots of "permission denied" messages from directories for which you don't have read permission. To avoid these, redirect the error messages to a null device and you won't see them:

find / -name myfile 2>/dev/null


Of course there's a great deal more to find -- check out man find for full details -- but it's only one tool in the command line arsenal. To my mind, if you're just seaching for files by name, you can't beat the updatedb/locate combination.

Got a useful find command? Leave a comment!



Previous Hidden LinuxNext Hidden Linux
<--Previous Hidden Linux      Next Hidden Linux -->


February 17, 2010


I don't know about you, but I treat my download cap as a target. I have a 20GB-a-month TelstraClear plan, and I do my darndest to use every byte. Why? Because caps are essentially stupid. Or rather, they're badly designed.

If I'm away for a month and use 0 bytes, it costs just the same as if I'd used my full 20GB. This wouldn't be so galling if some allowance were made for under-utilising my capacity. It doesn't have to be a 1:1 thing or roll over from month to month, but some concession would be nice. Perhaps a 1:2 ratio that must be used within the next billing period; in this case an allowance to go up to 30GB in the next month seems reasonable.

That would also get around the other irritating thing about data caps, the punitive charges if you go a single byte over your limit. In the case of TelstraClear it's $2.95 per GB or part thereof.




That'll be $2.95 please!

What got me thinking about this was this BBC report. Apparently "the majority of broadband users in the UK pay for download limits that they come nowhere near reaching." Is this the case in NZ? How much of your limit do you use? Post a comment and let me know.


February 10, 2010

The Linux command line is immensely powerful, especially if you combine it with handy popup access from an application like Yakuake, but sometimes you just want to know what string to type without having to wade through screens of man pages. That's what this occasional series is about.

(As always, you can type man <command_name> for full details about a command.)

df - Disk free space
Show disk usage and free space:
df

Show disk usage and free space in "human-readable" format (like 1K, 10M, 4.2G):
df -h

Show disk usage and free space in "human-readable" format but using powers of 1,000, not 1,024 (just like disk drive manufacturers do when quoting the sizes of their drives!):
df -H


du - Disk usage
Show file space usage in the current directory:
du

Show file space usage in the current directory in "human-readable" format:
du -h

Show file space usage in your home directory:
du -h ~

Sort usage to display the largest files last:
du -h | sort -n

Summarise the current directory's usage:
du -sh

Summarize usage by all level 1 sub-directories (not sub-sub-directories, etc.):
du -sh *

Show the file space used in /usr/share/icons:
du -sh /usr/share/icons/

Summarise the file space used by all sub-directories in /usr/share/icons:
du -sh /usr/share/icons/*

Show the size of all sub-directories in your home folder:
du -sh ~/*



Any more useful ones? Leave a comment!

Previous Hidden LinuxNext Hidden Linux



February 2, 2010

The Electronic Frontier Foundation have come up with an interesting toy called Panopticlick. With the tagline "How unique -- and trackable -- is your browser?" it checks the information you present to every website you visit -- and gives you a score! After clicking the Test Me button I discovered that only one in 165,415 browsers have the same fingerprint as mine and that my fingerprint converys 17.34 bits of identifying information. It then proceeds to list what it's learned.

The interesting figures (for me) were the Browser Plugin Details and System Fonts: 1 in 165,414 and 1 in 3,308 respectively. Though I knew quite a lot of stuff "leaks", I had no idea hosts could pick up such esoteric information.

Panopticlick of course works on a statistical basis, and with a dataset of only "several hundred thousand visitors" so far it's assessment isn't necessarily too sharp at present. Still, an interesting exercise. As they note in the FAQ;

"We'd have gotten better data by putting these tests in an invisible corner of a high-traffic website, but that simply isn't the EFF way when it comes to running an experiment like this: we wanted to make sure people knew they were participating, and let them know — even approximately — how rare/unique they were."

So how unique are you? Add a comment ...!

January 29, 2010


Oh dear. How embarrassing. For three days now parts of Telecom's XT mobile phone network have been broken.

Q: What is the XT Network?
A: New Zealands world class 3G mobile network     [source]

World class?

According to CEO Paul Reynolds, the fault was caused "by a piece of hardware which developed a signalling problem." Well I have one word for Dr Reynolds: redundancy. No, I don't mean sack the bastard. What I'm referring to is the term used by technicians and engineers -- you know, the people who actually do the real work in a company -- for critical componentry. If you have a piece of hardware that, if it failed, could take out tens of thousands of customers south of Taupo, you duplicate it. It's like keeping a spare tyre in the boot. Yes, it takes up room, but getting a puncture won't leave you stranded.

Even non-tech, non-Telecom folk knew about this a month ago, but the problem with redundancy is that it costs, and in a cheeseparing outfit like Telecom, costs are kept to a minimum -- with the exception of CEO and Board member remuneration of course. But what you save in one area, you may lose heavily in another.

Q: What makes it better than Vodafone?
A: 97% 3G coverage, roaming on ALL phones to over 190 countries, voicemail that works overseas...      [source]

(Just don't try using it in Dunedin, Invercargill, Timaru or Queenstown.)

This must be hugely alarming for Telecom shareholders. The company has dropped the ball in the one area where it has significant national competition. Most residential customers don't have a choice, but mobile users do. And they go and f**k it up twice in two months!

The real cost to Telecom is a massive credibility gap. The company already has a reputation for broken promises. Anyone recall the "max broadband" campaign a few years back? We charted it here (and here), and Telecom were eventually prosecuted by the Commerce Commission for misleading advertising. Now it's credibility as provider of business-class solutions is also in tatters.

Perhaps the broader connotations of that R-word should be considered after all...

January 25, 2010

Tucked away behind a right-click on any KDE 4 menu bar is an intriguing set of Advanced controls, amongst which you'll find Special Windows Settings which allows you to control almost every aspect of a windows placement and appearance. Want OpenOffice.org to always open centred on the second desktop? Want Firefox to open full-screen and without a taskbar or border? The settings are here!

To open access them, either right-click on the application's menu bar or left click the icon in the window's top-left corner. Choose Advanced then Special Windows Setting from the drop-down menu




The resulting dialog box has five tabs and a plethora of controls but usage is very straightforward. The most useful tab, Geometry, opens by default. Tick a tag on the left to activate a setting, then choose from the drop-down options on the right. In the above example, I've forced the window to always open centered on my desktop. What you choose on the left affects what's available on the right. Apart from "centered" I could have chosen any of these options...



There's another bunch of controls under Preferences:



Here you have options to omit borders, skip taskbars, apply shortcuts, control window opacity and even enable close buttons on windows that don't normally allow it.

Workarounds has some useful options to...



including setting maximum and minimum sizes, window types and blocking global shortcuts - particularly useful where global settings clash with an application's default shortcut keys.

You can also list, add and modify window settings from within System Settings. Just click the K-menu, choose Settings, System Settings, Windows Behaviour and Window Specific.





Previous Hidden LinuxNext Hidden Linux



January 18, 2010

top is a great command line tool for seeing what's running on your system and what's currently gobbling up your CPU, but how can you tell what's consuming your bandwidth?

Naturally Linux has a ton of network monitoring options. You can use iftop to display bandwidth usage, ifstat to report on interface statistics, or use the fully-fledged network sniffer, ethercap. But if you want a quick look-see of what's going on in real time, you can't beat NetHogs.

"Instead of breaking the traffic down per protocol or per subnet like most tools do, [NetHogs] groups bandwidth by process. ... If there's suddenly a lot of network traffic, you can fire up NetHogs and immediately see which PID is causing this. This makes it easy to indentify programs that have gone wild and are suddenly taking up your bandwidth." In short it's top for networks!



Install it from your usual package manager or under Ubuntu type sudo apt-get install nethogs.



Previous Hidden LinuxNext Hidden Linux  


January 14, 2010


Most of the country's back at work this week after the Christmas hols, so here's a quick roundup of some of the tech stories you may have missed.


GSM encryption cracked
German computer scientist Karsten Nohl and his team spent five months cracking the A5/1 encryption algorithm used by GSM mobile phone networks. According to a BBC report, it could "allow anyone - including criminals - to eavesdrop on private phone conversations." All you need is a "beefy gaming computer and $3,000 worth of radio equipment" - plus a copy of Nohl's translation table.

You'll find more details here along with links to download the table. (Caution: it's around 2.5GB!) You can also download a one-hour video of Karsten Nohl and Chris Paget's conference presentation here - it's tagged "gsm_srsly".  ) Use the torrent file for the quickest download.)


Twitter bans passwords
Possibly as a result of a Twitter employee's account being hacked earlier in the year, the company banned 370 "obvious" passwords. (Actually, it's really only 369 as the password "password" appears twice.) Some of them I wouldn't have thought were particularly obvious, but it's a salutory warning nonetheless. If you use any of the following on important sites it might be time for a password change ...

1. 111111
2. 11111111
3. 112233
4. 121212
5. 123123
6. 123456
7. 1234567
8. 12345678
9. 131313
10. 232323
11. 654321
12. 666666
13. 696969
14. 777777
15. 7777777
16. 8675309
17. 987654
18. aaaaaa
19. abc123
20. abc123
21. abcdef
22. abgrtyu
23. access
24. access14
25. action
26. albert
27. alexis
28. amanda
29. amateur
30. andrea
31. andrew
32. angela
33. angels
34. animal
35. anthony
36. apollo
37. apples
38. arsenal
39. arthur
40. asdfgh
41. asdfgh
42. ashley
43. august
44. austin
45. badboy
46. bailey
47. banana
48. barney
49. baseball
50. batman
51. beaver
52. beavis
53. bigdaddy
54. bigdog
55. birdie
56. bitches
57. biteme
58. blazer
59. blonde
60. blondes
61. bond007
62. bonnie
63. booboo
64. booger
65. boomer
66. boston
67. brandon
68. brandy
69. braves
70. brazil
71. bronco
72. broncos
73. bulldog
74. buster 
75. butter
76. butthead
77. calvin
78. camaro
79. cameron
80. canada
81. captain
82. carlos
83. carter
84. casper
85. charles
86. charlie
87. cheese
88. chelsea
89. chester
90. chicago
91. chicken
92. cocacola
93. coffee
94. college
95. compaq
96. computer
97. cookie
98. cooper
99. corvette
100. cowboy
101. cowboys
102. crystal
103. dakota
104. dallas
105. daniel
106. danielle
107. debbie
108. dennis
109. diablo
110. diamond
111. doctor
112. doggie
113. dolphin
114. dolphins
115. donald
116. dragon
117. dreams
118. driver
119. eagle1
120. eagles
121. edward
122. einstein
123. erotic
124. extreme
125. falcon
126. fender
127. ferrari
128. firebird
129. fishing
130. florida
131. flower
132. flyers
133. football
134. forever
135. freddy
136. freedom
137. gandalf
138. gateway
139. gators
140. gemini
141. george
142. giants
143. ginger
144. golden
145. golfer
146. gordon
147. gregory
148. guitar
149. gunner
150. hammer
151. hannah
152. hardcore
153. harley
154. heather
155. helpme
156. hockey
157. hooters
158. horney
159. hotdog
160. hunter
161. hunting
162. iceman
163. iloveyou
164. internet
165. iwantu
166. jackie
167. jackson
168. jaguar
169. jasmine
170. jasper
171. jennifer
172. jeremy
173. jessica
174. johnny
175. johnson
176. jordan
177. joseph
178. joshua
179. junior
180. justin
181. killer
182. knight
183. ladies
184. lakers
185. lauren
186. leather
187. legend
188. letmein
189. little
190. london
191. lovers
192. maddog
193. madison
194. maggie
195. magnum
196. marine
197. marlboro
198. martin
199. marvin
200. master
201. matrix
202. matthew
203. maverick
204. maxwell
205. melissa
206. member
207. mercedes
208. merlin
209. michael
210. michelle
211. mickey
212. midnight
213. miller
214. mistress
215. monica
216. monkey
217. monkey
218. monster
219. morgan
220. mother
221. mountain
222. muffin
223. murphy
224. mustang
225. naked
226. nascar
227. nathan
228. naughty
229. ncc1701
230. newyork
231. nicholas
232. nicole
233. nipple
234. nipples
235. oliver
236. orange
237. packers
238. panther
239. panties
240. parker
241. password
242. password
243. password1
244. password12
245. password123
246. patrick
247. peaches
248. peanut
249. pepper
250. phantom
251. phoenix
252. player
253. please
254. pookie
255. porsche
256. prince
257. princess
258. private
259. purple
260. pussies
261. qazwsx
262. qwerty
263. qwertyui
264. rabbit
265. rachel
266. racing
267. raiders
268. rainbow
269. ranger
270. rangers
271. rebecca
272. redskins
273. redsox
274. redwings
275. richard
276. robert
277. rocket
278. rosebud
279. runner
280. rush2112
281. russia
282. samantha
283. sammy
284. samson
285. sandra
286. saturn
287. scooby
288. scooter
289. scorpio
290. scorpion
291. secret
292. sexsex
293. shadow
294. shannon
295. shaved
296. sierra
297. silver
298. skippy
299. slayer
300. smokey
301. snoopy
302. soccer
303. sophie
304. spanky
305. sparky
306. spider
307. squirt
308. srinivas
309. startrek
310. starwars
311. steelers
312. steven
313. sticky
314. stupid
315. success
316. summer
317. sunshine
318. superman
319. surfer
320. swimming
321. sydney
322. taylor
323. tennis
324. teresa
325. tester
326. testing
327. theman
328. thomas
329. thunder
330. thx1138
331. tiffany
332. tigers
333. tigger
334. tomcat
335. topgun
336. toyota
337. travis
338. trouble
339. trustno1
340. tucker
341. turtle
342. twitter
343. united
344. vagina
345. victor
346. victoria
347. viking
348. voodoo
349. voyager
350. walter
351. warrior
352. welcome
353. whatever
354. william
355. willie
356. wilson
357. winner
358. winston
359. winter
360. wizard
361. xavier
362. xxxxxx
363. xxxxxxxx
364. yamaha
365. yankee
366. yankees
367. yellow
368. zxcvbn
369. zxcvbnm
370. zzzzzz


Oz to filter the net
Mandatory internet filtering got the green light in Australia in mid-December with the announcement that new legislation entitled "Measures to improve safety of the internet for families" would be introduced this year. Nicknamed the Great Firewall Reef and the Rabbit Proof Firewall, the Aussies plan to block up 10,000 websites. No doubt one of the first on the list will be Wikileaks after they revealled that an initial blacklist included "the websites of a Queensland dentist, a tuckshop convener and a kennel operator".


Microsoft Word (almost) banned in the US
Just before Christmas Microsoft lost a patent appeal concerning the use of XML in its Office suite and was ordered to pay US$290 million in damages to a Canadian company called i4i. An injunction on further sales of Microsoft Word was due to come into effect on 11 January, but a couple of days before Microsoft appealed the appeal.

The technology in question relates to the .DOCX and .DOCM file formats that became part of Office in 2007. Silly buggers should have just used ODF. It's an open and completely free standard used by everything from Adobe Buzzword to Zoho Office. Oh hang on, it's Microsoft isn't it. Better call in the wheel re-inventors ...


Tax-free Google
A while ago I reported how Microsoft in the UK paid just 0.038% tax in 2007 -- equivalent to $38 for every $100,000 earned. Now Google have pulled off a similar trick, paying a mere £600,000 tax on revenues of £1,250,000,000. By channeling 90% of their business through Ireland, they took advantage of a difference in tax rates and saved themselves an estimated £100 million quid.

Rumours of this blogger forming a corporation and moving to Ireland are entirely unfounded, to be sure, to be sure ...


December 21, 2009


Who doesn't like robots? Especially when they're destroying a city? Uruguayan film-maker - and, if I read the Spanish credits right, model robot-builder - Fede Alvarez does. According to the BBC, within days of his 5-minute clip Ataque de Panico! ("Panic Attack!") hitting YouTube he was beseiged with offers from Hollywood and now has a $30 million dollar contract.  Even more remarkably, his original clip was made on a budget of just $300!




Exterminate, exterminate ... and Merry Christmas!