All posts tagged #bash all posts RSS-feed

"Invite" someone to ssh into your machine without port forwarding or firewall changes

If you want to let someone log into your machine or you want to log back into your machine from your server for some reason, normally you'd just set up port forwarding and connect to your IP. But there is another way: you can use ssh to create a connection to a remote machine, which that person can then use to log into your machine. Advantages: No need to set up port forwarding if you're on a network. No need... full post»
by Mark,

Minimal logging server & clients

Having solved backups, I attacked the the next important thing that gets in the way of building actual functionality: error logging. I've had some trouble setting up Sentry (possibly more my fault than Sentry's, but it does much more than I need so it's more work). I also tried Loggly which doesn't need server setup, but it captured mostly irrelevant syslog stuff and I'd need to pay a lot to keep logs for more than 7 days. So I figured... full post»
by Mark,

Dory backup scripts

I made a backup script that is working pretty nicely for me so far. It has several function, the last one being the essence of it. Make a dump of all databases (postgres & mysql) to zipped sql files. It deletes any that haven't changed since the last backup. Bring a list of git repositories up-to-date with with their remotes on the current branch, by cloning or pulling. (This is useful to have a backup of a non-bare repository). Make... full post»
by Mark,

Logging to files

Logging the output of a shell script is easy enough: ./ 1> log.out 2> log.err But if it the output is long and you find an error, you might want to know which output corresponds to it. Logging errors to one file, and output+errors to another is a little more tricky. And there are other potentially useful features: Truncate the log file if it gets too long. Keep the last part, and ideally whole lines. Add timestamps to each line... full post»
by Mark,

The blag!

#imadethis, #coding, #tools, #python, #bash, #machine-learning, #ubuntu, #music, #django, #focus, #fortran, #backup, #chinese, #charity, #learning, #travel, #order-of-magnitude, #R, #javascript, #personal, #cross-validation, #china, #data-science, #discussion, #data-analysis, #effecive-altruism, #games


  1. Rainbow colormap in javascript @Mark The post has been expanded to include non-rainbow colorm...
  2. "Invite" someone to ssh into your machine without port forwarding or firewall changes @Mark Added details about how to use the established tunnel in...
  3. Rainbow colormap in javascript @Mark Now finally with color-coded source!
  4. Bye Make, hello SCons (Fortran) @Mark For SCons' own comparison against alternatives, have a l...
  5. Ubuntu macros @Mark Macro locks have been made more reliable, to prevent any...
  6. Dory backup scripts @Mark I've added some functionality to remove old backups! htt...
  7. Ubuntu macros @Mark Updated after moving the files to
  8. Concentration noise @Mark Sorry if you're in China and can't access Youtube. If th...