Formatting csv files in shell
Often it is easier to read csv files if they are formatted as a table. One of my ansible playbooks outputs a list of machines o a csv file.
Often it is easier to read csv files if they are formatted as a table. One of my ansible playbooks outputs a list of machines o a csv file.
With scp
you can use -J
directly. Like scp -J user@proxyhost.example.org user@hiddenhost:/directory/some/file.zip .
for example.
As usual, the 'user' part can be left out if the user is the same on the hosts in question.
The ssh
command has the useful '-J' option which allows you to connect via a proxy host. Very useful for hosts which are not directly reachable from the current network you are on.
Since '-J' corresponds to the ProxyJump directive, you can achive the same goal with sshfs like this: sshfs hidden-host.example.org:/some/directory/ ~/mountpoint/ -o ProxyJump=proxy.example.org
this is very useful.
Sometimes I write content via a ssh connection, using vi as my editor. In order to deploy new content, it is useful to have ssh-agent running. Ony way to do that is like this:
[nikola] tingo@kg-core2:~/personal/projects/nikola % eval `ssh-agent -c` Agent pid 65221
This command sets the environment variables SSH_AUTH_SOCK and SSH_AGENT_PID, and you are ready to add keys with ssh-add
. When you are finished, you just use ssh-agent -k
to kill the agent.
Nikola uses the slug of a post or page to generate the output files and directories. So if you (for any reason) decide to rename a source file, remember to rename the slug also. Or else you will spend frustrating time wondering why nikola persists in rendering something at an old location. Perhaps you will try clearing the cache, removing the doit database, or even clearing the output directory and getting even more frustrated when it doesn't help.
When I set up the webserver this very site is running on, I had trouble with Nginx at first.
I now have manual deployment working. So now I set up a series of deployment commands in conf.py and try the out
DEPLOY_COMMANDS = { 'default': [ 'cd output; git add .', 'cd output; git commit -q -m "content added"', 'cd output; git push web', ] }
Will it work? Update: yes it works nicely. Nikola scores again!
Learning to work with Nikola, instead of against it. Sometimes it is better to go with the flow.
I followed the Using git to manage a web site howto. But it didn't work at first. Since I'm not very familiar with git "bare repositories", I started looking at that part. As it turns out, I should have started with the basics.