Broadcast Engineer at BellMedia, Computer history buff, compulsive deprecated, disparate hardware hoarder, R/C, robots, arduino, RF, and everything in between.
2512 stories
·
3 followers

Show max lengths of all fields in a pipe delimited file with header row

1 Share
$ awk -F"|" 'BEGIN {OFS="|"} NR==1 {for (b=1;b<=NF;b++) {hdr[b]=$b} } NR > 1 {for (i=1;i<=NF;i++) {if(length($i) > max[i]) max[i] = length($i)} } END {for (i=1;i <= NF;i++) print hdr[i],max[i]+0}' pipe_delimited_file.psv

commandlinefu.com

by David Winterbottom (codeinthehole.com)

Read the whole story
Share this story
Delete

List the size (in human readable form) of all sub folders from the current location

1 Share
$ du -sk -- * | sort -n | perl -pe '@SI=qw(K M G T P); s:^(\d+?)((\d\d\d)*)\s:$1." ".$SI[((length $2)/3)]."\t":e'

Tested on MacOS and GNU/Linux.

It works in dirs containing files starting with '-'.

It runs 'du' only once.

It sorts according to size.

It treats 1K=1000 (and not 1024)

commandlinefu.com

by David Winterbottom (codeinthehole.com)

Read the whole story
Share this story
Delete

Fantastic tabletop Battle of Hoth

2 Shares
battleOfHoth

Incredible Battle of Hoth gaming table created by the fine gaming enthusiasts at Beasts of War. Video below. Read the rest

Read the whole story
Share this story
Delete

All The Video Game Easter Eggs That Reference ‘Indiana Jones’

1 Share

Indiana Jones is an awesome pop culture icon, so it makes sense nods and references to him would make it into many games. Here are some of the best examples.

May want to wear your fedora to watch this. Makes it feel more authentic.

Via FunWithGuru

The post All The Video Game Easter Eggs That Reference ‘Indiana Jones’ appeared first on Geeks are Sexy Technology News.

Read the whole story
Share this story
Delete

The 6 Craziest Mass Extinctions Ever

1 Share

The 5 most incredible mass extinctions ever to occur and a look at whether the sixth might be occuring right now.

[ASAPScience]

The post The 6 Craziest Mass Extinctions Ever appeared first on Geeks are Sexy Technology News.

Read the whole story
Share this story
Delete

App note: Magnetic stripe reader

1 Share

an_sillabs_an148

Application note(PDF) from Silicon Labs on Magnetic stripe reader (MSR) implementation.

Magnetic stripe readers (MSRs) are widely used in many different applications such as point-of-sale terminals and key card readers. The C8051F330 is capable of integrating MSR functionality in a very small space with few external components. The high-speed, high-resolution ADC, coupled with a fast controller core makes this integration possible. This design demonstrates a two-channel MSR function using the on-chip ADC to read information directly from the magnetic read head. Output can be viewed using a PC’s terminal program via an RS-232 connection.

Read the whole story
Share this story
Delete
Next Page of Stories