Reputation
689
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
5 11
Newest
 Civic Duty
Impact
~21k people reached

  • 0 posts edited
  • 0 helpful flags
  • 306 votes cast
Apr
6
revised Transpose a file, and replace missing values
Removed promise of additional code after no feedback from the OP for this much.
Apr
4
answered How do I use man pages to learn how to use commands?
Apr
3
comment Is using “while true” to keep a script alive a good idea?
If you know the file is good before it leaves the pi, then you could just run a checksum like md5 or sha1 and send that along with your file. Then the receiver will know if it got a bad file before it tries to process it. If you don't know that, then you can still build some sort of partial or block checksums or something similar into your data file which insures data integrity, so you can check things as you go before you commit to a process which can fail. An ounce of prevention ...
Apr
3
comment how to get rsync to link identical files with --link-dest option if an old file already exists?
If you don't get the answer you need here, you can post on the rsync list. The rsync developers regularly answer questions there along with many advanced users. You can find them via lists.samba.org/mailman/listinfo/rsync . I mostly lurk there and learn a lot.
Mar
25
revised An alternative to `xdotool type`
outdated link
Mar
22
comment When can I edit strings in an executable binary?
Good answer. sed can do lots of things, but, in general, that's what binary editors were invented for. They can be challenging to use when navigating within a large binary file, but they will let you change things byte by byte. I use hexedit when I have to examine or change a binary file. You can use strings -t x file | less to locate the offsets of the (printable) strings you want to change before jumping into the editor.
Mar
7
revised Transpose a file, and replace missing values
improved formatting and clarified a few things
Mar
7
answered Transpose a file, and replace missing values
Feb
21
comment What does CRON=1 do?
@Bratchley - just to be nit picky ;) - What if there are scripts, etc. which are on unmounted media that you can't get to, or scripts you don't have write permission for? Then, a new name could involve a lot of possible consequences with very little upside. I know I get too used to having root/sudo permissions on my machine - so I can do anything - and then assume somewhat unjustified omnipotence.
Feb
16
comment Remap Return key in terminal to prevent accidental command on productions servers
I know several ways to do this in an X environment, but you usually don't have that on a server. I found this which might set you off in the right direction. bbs.archlinux.org/viewtopic.php?pid=1021839#p1021839
Feb
6
comment Pipes, how do data flow in a pipeline?
See also this question which shows how to use stdbuf which might also be helpful. unix.stackexchange.com/questions/182537/…
Jan
8
comment How to kill a runaway cat?
Wouldn't the killall -9 cat also kill any other cat instances that might still be doing good things in other process threads?
Jan
8
comment Autostart with AutostartCondition
I use KDE, so I'm sure I'm missing some fine points here, but: If it's a gui program, it needs the desktop environment to be already running. So why not just write an autostart script for it that your desktop will run when it starts. That script can test for any conditions you like and decide what to do. For example, see cyberciti.biz/tips/… . I don't get the gsettings part, but that may just be because I don't use that desktop.
Jan
8
comment How to write bash script to configure my displays when HDMI is plugged in or unplugged
Upon further research, it appears that automatic audio switching was not implemented because it was not clear how to determine which audio device a user would want to use. This can be implemented by a user with a custom udev rule, but I haven't figured out how yet. For now, I have a shell script tied to an icon on my taskbar which I just have to click to do it manually.
Dec
26
comment Switch to parent shell without logging out
If you are using a gui desktop, you can just open another terminal window or tab or even switch to another virtual console. If not, use screen as stated in one of the answers.
Dec
17
comment Get total duration of video files in a directory
Thanks, the following (maybe unformatted) works DUR=$(avprobe -loglevel quiet -show_format_entry duration "$1"); DUR=$(cut -d '.' -f 1 <<< "$DUR"); ((DUR_MIN=DUR/60)); echo "${DUR_MIN}" I truncated the fractional seconds to avoid processing a floating point value.
Dec
16
comment Get total duration of video files in a directory
Can you do this (ffprobe method) with something like avconv? I can't find ffmpeg in my repos for Kubuntu 14.04 - so I don't have ffprobe either? I do have avprobe, but it doesn't like those arguments.
Dec
16
comment Security implications of forgetting to quote a variable in bash/POSIX shells
I'm no bash expert, but I've been coding in it for over a decade. I used quotes a lot, but mainly to handle embedded blanks. Now, I'll use them a lot more! It would be nice if someone would expand on this answer to make it a little easier to absorb all the fine points. I got a lot of it, but I missed a lot too. It's a long post already, but I know there's a lot more here for me to learn. Thanks!
Dec
15
awarded  Popular Question
Nov
27
comment Is there a standalone tool which will write reports from CSV data files
I just took a look at csv2odf. Apparently it does a lot more than just converting the csv into a document. I'll have to study it more when I'm more awake.