Skip to content

Instantly share code, notes, and snippets.

View schlomo's full-sized avatar

Schlomo Schapiro schlomo

View GitHub Profile
[Desktop Entry]
Version=1.0
Type=Directory
Icon=is24-applications
Name=IS24
Comment=IS24 tools and utilities
Comment[de]=IS24 Werkzeuge und Hilfsmittel
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=IS24 VPN Client for SSLGW
Comment=Use to connect the VPN with a simple GUI
Exec=is24vpn-gui
Terminal=false
Icon=is24vpngui
Type=Application
Categories=Network;X-IS24;
@schlomo
schlomo / httpd_replace_config.sh
Created May 2, 2014 12:26
Replace httpd.conf with list of includes
if ! echo '# HTTPD conf framework. Will be overwritten to this content on each install of the rpm package!!!
# This file is managed by %{name}-%{version}-%{release}
ServerRoot "/etc/httpd"
Include conf/basic/*.conf
Include conf/main/*.conf
Include conf/other/*.conf
' >/etc/httpd/conf/httpd.conf ; then
logger -p user.err -s -t %name -- "ERROR: Could not replace content of '/etc/httpd/conf/httpd.conf'"
fi
@schlomo
schlomo / ssh_config_patch.sh
Created May 2, 2014 12:24
Simple sed patcher
sed -i -f - /etc/ssh/sshd_config <<EOF
1{
i # this content comes from the %{name}-%{version}-%{release} package
i AddressFamily inet
i Protocol 2
i LogLevel VERBOSE
i HostbasedAuthentication yes
i IgnoreUserKnownHosts yes
i IgnoreRhosts yes
i Banner /etc/ssh/banner.txt
@schlomo
schlomo / sshrc
Last active August 29, 2015 13:56
SSH RC script that helps me with reconnected screen sessions and deploys my personal environment
#!/bin/bash
# xauth handling, code adapted from sshd(8)
if type -p xauth >/dev/null && read proto cookie && [[ "$DISPLAY" ]]; then
if [[ "${DISPLAY:0:10}" = 'localhost:' ]] ; then
# X11UseLocalhost=yes
#echo add unix:"${DISPLAY:11}" $proto $cookie #### egrehm changed to :10 because seems to be broken on rhel6 and clones
echo add unix:"${DISPLAY:10}" $proto $cookie
else
# X11UseLocalhost=no
echo add "$DISPLAY" $proto $cookie