Skip to content

u/cloudadmin

In this archive from May 2013 to Jul 2024

1
posts
25
comments
1
media
257
score

I like to keep it super simple with git hooks:

cat ~/.dotfiles/.git/hooks/post-commit

  find ~/.dotfiles -type f -name ".*" -maxdepth 1 -exec ln -s -f {} --target-directory=$HOME \;

  find ~/.dotfiles -type d -name ".*" -maxdepth 1 ! -name '.git' -exec ln -s -f {} --target-directory=$HOME \;

Whenever I make a change to a dotfile in~/.dotfiles/ I commit it, and the hook creates the symlink.

Simple.

3 points

I use Spectacle, livestreamer and VLC on Mac. You can start VLC in borderless mode. I'm on my phone and can update later. But I got it borderless in the latest release by unchecking the preferences Window Decoration and Use Interface. If you google for it, you should be able to find detailed instructions.

1 points

Still a work in progress. I realized the dotfile git history needs some cleaning up before I can make it public, but I can share the individual files if anyone is interested. I've spent quite a bit of time tweaking this, and I'm finally pretty happy with it.

In case anyone is wondering, I'm using iTerm2 with the title bar turned off. Relatively new feature on the nightly build.

Edit: I posted this late last night and didn't have enough time to add some more details.

Here are my configs:

13 points

I have an openvpn server that crashes with a GLib error and stops accepting connections or routing data. The crash leaves a dead process, which causes the service openvpn restart command to fail, since it finds an existing process. So you have to find the pid of the dead process, then kill it by hand. Since it logs the same string, I have a cronjob that parses the log file for the string, and when the string is found, it runs the script, and emails me:

/1 * * * * tail -50 /var/log/openvpn/openvpn.log|grep GLib-ERROR && /root/bin/openvpn-self-healer.sh 2>&1|mail -s "OpenVPN has healed itself" spamola@domain.com

Below is the script, but it only works some of the time. It gets the pids of all current openvpn processes, kills each one, then calls the openvpn init script restart function, (I know it's still part of the loop and runs more than once, I'm open to suggestions, I'm new).

#!/bin/bash 
for i in $( ps ax | grep openvpn | awk '{print $1}' ); do 
  kill -9 $i 
  sleep 1 
  /etc/init.d/openvpn restart 
done 

Ideally, I'd like to have this work every time, but I'm not sure what causes the inconsistent behavior. Can someone explain why this fails part of the time, and/or offer advice on how to make the script better?

*Also, I cant get it to format like it is in vi, forgive me, and tell me how I do that.

FTFY

2 points

I don't have an answer for you unfortunately, since I have yet to find a simple description of everything you are looking for. However, I can recommend an amazing video series on encryption from Khan Academy that helps understand the underlying mechanics: KhanAcademy: Encryption.

I hope others are able to chime in and provide some good sources. I'd love to read them.

2 points

Number two above could definitely be a viable solution. I'm always quick to recommend Ansible over Puppet/Chef for people not necessarily looking to get knee-deep into configuration management. It's easy to learn to and is easy to get set up. Also, Ansible can be 'pushed-based' rather than 'pull-based', meaning it can be updated and have the changes pushed out, making it easy to manage almost anything you need on a Linux host.

LDAP can be difficult to get up and running, so Ansible would probably be an easier solution.

1 points

End of this list.

Back to top

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.