Skip to content

auto-formating tool for django html template files

Is there a *nix tool (or vim plug-in) that would allow me to automatically format django html template files? Hitting the space bar hundreds of time does not sound like a good use of my time but then neither does leaving some weird formatting that is hard to read. Answer Install vim-jinja2-syntax plugin by putting Glench/Vim-Jinja2-Syntax when installing it with

How to use Arduino-Makefile with Sparkfun Pro Micro?

So, I am using Arduino-Makefile ( and trying to program a 5V 16MHz Sparkfun Pro Micro ( I am using the versions of the Arduino libraries and Arduino-Makefile in the repository of the Linux distro I am using (Linux Mint 17.2). These versions are 1.0.5 and 1.3.1 respectively. My file structure looks like this: My test.ino is taken directly from

Get Subnet mask in Linux using bash

I am using bash to get the IP address of my machine with that script: And now I am trying to get the Subnet Mask in this type: But I have no idea how can I do that. Answer there are couple of ways to achieve this: first: to print the mask in format, you can use this: second:

How do symlinks in a host volume work in Docker containers?

My question is about what happens when you create a symlink from inside a container in a host mounted directory. It’s easiest if I just ask with an example. Assume we start a container like so. Most of the command doesn’t matter, what’s important here is the host volume mount. While in the container I create a symlink in the

How to feed awk input from both pipe and file?

I was wondering how do I get awk to take a string from the pipe output and a file? I’ve basically have a chain of commands that eventually will spit out a string. I want to check this string against a csv file (columns separated by commas). Then, I want to find the first row in the file that contains

Using cut to remove until a delimiter from end

I have a string with many delimiters like : abcd – efgh – foobar.extension (Delimiter ‘-‘) I want to remove the So far, I have done But this does not help as it echo’s I want to be able to keep the inital part before the final delimiter(‘-‘) is found. Answer In bash you can use this built-in string manipulation:

Circular SSH Tunnel

Is is possible to create a circular SSH Tunnel? local1 >SSH_TUNNEL> remote1 >SSH_TUNNEL> local1 On “Remote1” I create a TAR that I want to pipe to STDOUT ( – ) … can I then TAR – . | >SSH_TUNNEL> local1 ssh user@remote1 “tar -cvf – . | ssh user@local1” I’ve googled and forum’d and googled some more … I can’t

Combining two bash commands

If found this code which gives pi Ip address and this which sends off to stream How can I get the output from 1st to replace the in second please? Answer Save the output of the first command in a variable: Btw, if your raspberrypi is running raspbian, then a much cleaner way to get the IP

what is the difference between uio.h and io.h?

Sometimes I see compiler complaining about this line with fatal error: sys/io.h: No such file or directory If I simply change it to It will magically work. Can someone explain to me the difference? Why do some OSes have one but not the other? Edit: This issue happens on a Linux, not just OS X. Answer Generally speaking, it is