Reputation
608
Top tag
Next privilege 1,000 Rep.
See vote count; VIP usercard
Badges
5 21
Newest
 Enthusiast
Impact
~24k people reached

Apr
17
comment Store 2^500 in a variable in bash
@StardustOne Not really. You can use arbitrary groups of characters with the two parameters, e. g. try echo "havk vf sha" | tr 'fhaskv' 'sunfxi' :) (this is rot13 for the poor man, with the chars deliberately unsorted to not give away the solution too soon :))
Apr
17
comment Store 2^500 in a variable in bash
@jimmij One thing; going the echo way is much more portable (think commercial *nixes). Plus, you must ensure that your /tmp is writable if you use here strings. Think of emergency consoles with / mounted ro - your here string approach will FAIL.
Apr
17
comment bash: -eq vs. == and `bc` output type
Can we agree that the manual is a bit too less clear and verbose on this matter still? ;)
Apr
17
comment bash: -eq vs. == and `bc` output type
Well, thanks for the explanation, but in fact I didn't "confuse" anything. I simply was unsure, hence I chose to ask. Plus, I wasn't able to determine the bc output type. Whatever, in the bash manual page, there was nothing written explicitly about the == being used for numbers - only for strings.
Apr
17
comment bash: -eq vs. == and `bc` output type
Just never thought of that, thanks for the inspiration. :) I'm a bash old-schooler and still not too familiar with the "modern" ${...#...} syntax using brace substitution.
Mar
23
comment Setting correct permissions automatically for certain file type when file is copied from non-Linux file system
All in all this is a nice approach, thank you. I think I can inject some more tricks into my script later myself, e. g. checking out the FROM file system whether it is NTFS, e. g. result=$(lsblk -no FSTYPE) and then test the $result value whether it reads "ntfs". Caveat: Some big HDDs might consist of partitions with both ext and NTFS file systems on them, so make sure your arguments for lsblk are partitions, not devices.
Mar
23
comment Setting correct permissions automatically for certain file type when file is copied from non-Linux file system
"since this type of behavior would make a lot of people happy" - You can say that again. It's no real fun always having to remove silly permission flags that do not belong there for audio files (e. g. executable in a standalone way).
Mar
23
comment Setting correct permissions automatically for certain file type when file is copied from non-Linux file system
This is fantastic! First time I've heard of this handy little program. Thank you so much, your answer is about to get my "accepted answer" vote, unless...wait and see.
Mar
23
comment dircolors: rules for _ext (rather than .ext)
No, there are no undocumented features. BUT someone has already tried hard to work on this issue, see lists.gnu.org/archive/html/bug-coreutils/2012-10/msg00057.html . Unfortunately the author of the patch decided to discard the patch shortly after for various reasons.
Mar
23
comment How to get the Adaptec 1200A to work under Linux at UDMA/100 (instead of 66)
Wait a moment...this could be the cause of the problem!! Telling from my log files, there is no driver used for this card, but the kernel uses its generic driver for initializing that card instead! I'll now have to find a way how to load the correct HPT370 chipset driver by trying to modprobe the pata_hpt37x kernel module, "telling" the kernel not to access the card using its generic methods. However, modules with the pata_ prefix are known to be experimental, hence there is a chance I will have to allow the use of these experimental modules...Whee, tricky stuff.
Mar
23
comment How to get the Adaptec 1200A to work under Linux at UDMA/100 (instead of 66)
Frankly? I doubt it! This is all you will ever get from the dmesg log: ata5: PATA max UDMA/66 cmd 0x(hexaddr) ctl 0x(hexaddr) bmdma 0x( hexaddr) irq xx. -- That one lone line really won't help much, otherwise I would have been more specific.
Mar
22
comment Intentional kernel panic under Linux?
@MichaelMrozek Oh, inducing this by force can be a great technique for people who use the kernel in embedded applications. Think of copy-protection mechanisms, respectively people using counterfeit / illegally modified hardware. The whole thinking behind to me seems very 80s, though: it reminds me of CBM Amiga times when they caused the "Guru" to blink if some copy protection was bypassed in erroneous (i. e. amateurish) ways ;)
Mar
22
comment How to get the Adaptec 1200A to work under Linux at UDMA/100 (instead of 66)
Yes, of course! With another non-Adaptec card, these disks do perform at UDMA/100 speed (or even higher, occasionally). Only whenever they're connected to the 1200A, they're recognized as UDMA/66 because the kernel "thinks" this card is only UDMA/66 hardware (which it definitely isn't). Plus, all my drives that could really only do UDMA/66 (max) were binned a long time ago. :) (Since they would act as system brakes, as you correctly pointed out)
Mar
21
comment How do I make my pc speaker beep
This will make my loudspeakers beep, but not the PC speaker as the asker wants to! I need the latter to beep, because my cables went off and I must check if I soldered (+) and (-) the right way!
Mar
19
comment Harddisk serial number from terminal?
Well, but you need to be superuser to use the -I option in hdparm. I would not want that either and prefer a way how to read out the ser # without root permissions. This is why I've upvoted don_crissti's solution only. – syntaxerror 57 secs ago
Mar
10
comment How do I set mouse double click speed in Lubuntu
Thanks a lot - just what I needed. Unfortunately, XinHua's solution is outdated and does no longer apply to latest Lubuntu versions.
Feb
12
comment How to figure out primary/secondary IDE channel via sysfs (if possible)
OK, thanks, but what if it is a PATA controller, with all but the primary slave channel connected to a device? Won't link just be numbered link1, link2, link3 anyway? I would not think that there will be a gap (as ..1, ..3, ..4).
Feb
12
comment Bash: handling “[[ statement ]] || echo problem found ; exit 1” logic
Thanks! More notes for beginners: 1) You must leave one whitespace after both the opening and closing brace. 2) Don't forget the semicolon after the last statement! If you do, you will get a very pointless (and misleading) error message: ''unexpected end of file'' (?!?)
Feb
8
comment “history” stops working when run inside bash script
Thanks too to the dude who recently downvoted me just because he can. (Probably a bash v3 user, out of mere frustration, haha). At least for Martin my solution was of great help, that's (at least) a comfort.
Feb
7
comment What if 'kill -9' does not work?
Umm, I always dislike this kind of "hard" field names with ps. Who can be sure that the required field will always be the 8th, with all implementations of ps in all Unices?