All posts tagged #bash all posts RSS-feed

Show recently changed branches (git)

To show your recent branches using git: git for-each-ref --count=10 --sort=-committerdate refs/heads/ --format='%(HEAD) %(objectname:short) %(color:green)%(refname:short)%(color:reset) - %(contents:subject) (%(committerdate:relative))' Example output: * 14d5da9 parsing3 - Update version and readme (4 weeks ago) ae05513 dev - Version 0.4.0 (4 weeks ago) 6c695f0 parsing1 - Improve underscore handling in ints (4 weeks ago) 47fece2 parsing2 - Some progress, but pest output is not close enough to AST (5 weeks ago) 6c5aba2 webui-abandoned - No JIT for now (5 weeks ago) 7c60c75 site-url -... full post»

"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»

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»

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»

Logging to files

Logging the output of a shell script is easy enough: ./script.sh 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»

Ubuntu macros

The macro feature of Notepad++ was really useful. On Ubuntu I've had to do without Notepad++, and anyway it would be better to have something that works inn any program. I've found/made something today, and since StackOverflow locks all questions about such things, I'll post it here. First, install xmacro using sudo apt-get install -y xmacro. The basic commands are xmacrorec2 > "$macrofile" and xmacroplay "$DISPLAY" < "$macrofile". I've made a few small improvements: Assigned hotkeys so I can use... full post»

The markv.nl blog!

#django, #java, #shell, #backup, #async, #rust, #type-systems, #travel, #R, #python, #object-oriented-programming, #bash

Comments

  1. "Invite" someone to ssh into your machine without port forwarding or firewall changes @Mark Added details about how to use the established tunnel in...
  2. Ubuntu macros @Mark Macro locks have been made more reliable, to prevent any...
  3. Dory backup scripts @Mark I've added some functionality to remove old backups! htt...
  4. Ubuntu macros @Mark Updated after moving the files to https://github.com/mve...