Reputation
710
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
6 24
Newest
 Yearling
Impact
~32k people reached

Aug
28
comment Deal with renamed videos in youtube-dl
Thanks for the info and the link. Well, in case that data is always added at the same (relative) offset (e. g. 1024 bytes before the end of the video, or even at invariable starting and ending offsets), even this would be possible to handle. But I'd have to do a more thorough test to be sure. :)
Aug
28
comment Deal with renamed videos in youtube-dl
Ah, OK. So this'd work, even though it seemed against your original intention, hence I chose not to mention it. :) Anyways, it's true: from user's (or client's side), the only way you can do is live with the duplicate already downloaded (as you can't prevent it from happening, as I explained above) and afterwards doing your deletion operations on it if need be.
Aug
28
comment Deal with renamed videos in youtube-dl
I'd say you can't. You must find a way to tell youtube-dl to skip downloading when files are equal byte-wise. And this can only be done in code (i. e. by expanding it (-->feature request??)), because the current version of the script will already have downloaded the video when you will be returned to your bash prompt again - no matter if already there or not.--- In comparison, think of an observer/intercepting mechanism in web servers that can hook in before any JavaScript is ever loaded. The same thing you need to do here before youtube-dl attempts to download from YT.
Aug
28
comment Deal with renamed videos in youtube-dl
I don't have a solution, but a hint: what about md5ing (or, if you insist, applying the good ol' crc32 on) the video file and doing a byte-wise file comparison? This would, however, have to be programmed into youtube-dl because once it has finished doing its work, there is no "post-operation" you can do on it. (Because you want to prevent the tool from downloading in the first place if the video already exists!)
Aug
13
comment Is there a difference between ./script and bash script?
In a nutshell: IMO using bash itself (instead of its built-in commands) for running a script I'd almost compare to "committing a crime."
Aug
13
comment Is there a difference between ./script and bash script?
Wait a moment...I have never written anything about the . command. That's yet another pair of shoes. I only mentioned ./script and source script in my answer, but not . ./script. Yes it can be confusing at times. Ah, and big thanks for the downvote. :P Yay, that felt so refreshing.
Aug
13
comment Is there a difference between ./script and bash script?
@Slothworks FWIW, source tryit.sh won't care about the status of the +x bit either :) In any case, I think the source way is much better than using the fairly huge bash binary itself to run a script which lacks the +x flag. I've never had a situation when I had to (mis)use bash as a trigger to run such non-executable script.
Aug
13
comment How to (really) disable NCQ in Linux
@Paebbels Oops, I should not have overlooked the FPGA bit. Well, this is indeed something completely different to our common HDDs connected to buses of mainboards of desktop PCs or notebooks ;-) "In such an environment it's far to complex to write hardware routines that perfectly handle MBRs and file system acesses". True. You won't be able to do without a HDL. And I can imagine that programming such thing is not for the faint of heart...even though the Wikipedia code example suggests that it's an utter walk in the park ;-)
Aug
12
comment Custom Kernel to Disable SATA and USB Devices
"You could completely disable USB too if you want" Yes...BUT...in this case I would recommend using one of the good ol' PS/2 mice. Because, to connect a mouse the modern way, you DO need an USB port. And supposing that, once logged on, some folks can get around quite well w/o mouse, they might simply connect another USB device to that "mouse" port. That's why it's called Universal Serial Bus: you can connect either hardware to this bus. There are no USB ports which are "only for mice" ;-)
Aug
12
comment How to (really) disable NCQ in Linux
> dd if=/dev/zero of=/dev/sdb bs=32M count=32 Dunno what you intended to do with that; but it will erase both the MBR and gazillions of blocks beyond. Doing this on a drive with the main system running on it (and grub installed on MBR, as in my case) would be fairly dangerous ;) Thought I'd write this here as a comment, to prevent some less-experienced folks from experimenting with your "cool" line...;)
Aug
12
comment How to get the Adaptec 1200A to work under Linux at UDMA/100 (instead of 66)
@StephenKitt Sorry for the long delay, had no time for experiments, hence I had to remove the card in the meantime.-- Though I doubt the init msgs you requested will tell much, here they are: pata_hpt37x: HPT370 using 33MHz bus clock | scsi host10: pata_hpt37x | scsi host11: pata_hpt37x
Aug
10
comment How do I remove persistent config data from APT?
Looks that aptitude is not (or no longer?) installed by default on some Ubuntu flavors. sudo apt-get purge <packagename> worked for me as well. I must say that the tool name apt-get is totally misleading, as it is NOT only meant to get/fetch files, but can do lots of other things. apt-tool would have been more appropriate and, above all, represent its scope much better. Oh, want to purge everything? Try this: sudo apt-get purge $(dpkg -l |grep '^rc' | awk '{print $2}' | tr '\n' ' ')
Aug
9
comment uniq a csv file ignoring a column, awk maybe?
Nice and elegant solution! (the perl one) However, as a total Perl rookie, it required me a little RTFM to understand what you were doing here. %lines (easily recognizable by its percent sign) is an associative array (aka "hash variable" in Perl lingo), which may accept "real" strings as key identifiers, not just index numbers. This is the element responsible for all that miraculous "magic" done here.
Aug
8
comment Shell script to fetch part of file name from input file and transform it into output file
@Archemar, well I am not so sure if this isn't yet another GNUism (i. e. gawk)...as I prefer my awk lines to remain portable, I always have to care for this fact...
Aug
8
comment Shell script to fetch part of file name from input file and transform it into output file
@Allen and OP seems to always use new username per question ;-) look this "question". Same user. 100.0% sure.
Aug
8
comment Transform CSV file using shell script
@Archemar I even hope so. This is not a write-me-a-script forum. Besides, I am really wondering why some of us IT people are unemployed and why OTOH some others do get employed who obviously do not have the basic logical skills to accomplish various tasks? Supposing I would write a script for him, A to Z. And who would grub the big $$$ at the end of the month? Not me, no? See, that's where things get interesting...
Aug
6
comment Linux replace last character in a csv file to new string
Thanks for the feedback. Works fine for me. You MUST have #!/bin/bash as first line, as my solution will only work with bash, not sh. I've just read you're using SunOS...maybe you actually got csh or ksh instead of bash? (This was actually the case with the SPARC workstations I had to fight my way through 15 years ago.) The syntaxes of csh and ksh differ a lot from bash's one.
Aug
6
comment Linux replace last character in a csv file to new string
OK, I'll add a shorter solution, but I'll keep this one anyway. I hate to use the sed -i fix-in-place option on the original file, because if there is anything wrong or misinterpreted, your original data will be messed up.
Jul
21
comment Execute only if it is a bash function
Oh thanks, didn't know that. I'm not going to use it though; the latter variant you quoted will increase readability by at least 25 percent (IMHO), since the $@ will even be understood by bash programmers who only know the more basic syntax.
Jul
21
comment Execute only if it is a bash function
This is really supposed to work? for f do? Shouldn't that be for f in <something> do instead? I'm wonder if a certain boolean condition could actually turn this into an infinite loop...