Skip to content

Instantly share code, notes, and snippets.

View dky's full-sized avatar
馃崪

dky

馃崪
View GitHub Profile
@dky
dky / gist:5535624
Created May 7, 2013 19:58
tar up all files to bootstrap new centos/rhel6 box. Make sure you restorecon -r /home/vagrant/.ssh if you have SELINUX enabled or you won't be able to log in.
tar -cvf vagrant.tar etc/passwd etc/shadow etc/group etc/sudoers etc/udev/rules.d/70-persistent-net.rules /home/vagrant/ etc/sysconfig/network-scripts/ifcfg-eth0
@dky
dky / gist:5535595
Created May 7, 2013 19:54
SSH error after copying .ssh directory from user to a new system.
May 7 10:42:02 localhost login: PAM unable to dlopen(/lib/security/pam_fprintd.so): /lib/security/pam_fprintd.so: cannot open shared object file: No such file or directory
May 7 10:42:02 localhost login: PAM adding faulty module: /lib/security/pam_fprintd.so
@dky
dky / gist:5497692
Created May 1, 2013 19:29
Openssl create certs.
openssl req -newkey rsa:2048 -subj '/C=US/ST=New York/L=Flushing/O=IT/CN=www.example.com' -keyout www.example.com.key -out www.example.com.csr
@dky
dky / gist:5454735
Last active December 16, 2015 15:19
Apache Nagios config
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType "Basic"
AuthUserFile /etc/httpd/.htpasswd.users
@dky
dky / gist:5384398
Created April 14, 2013 21:54
Genesis customize footer.
// Customize the credits
add_filter( 'genesis_footer_creds_text', 'custom_footer_creds_text' );
function custom_footer_creds_text() {
echo '<div class="creds"><p>';
echo 'Copyright &copy; ';
echo date('Y');
echo ' &middot; <a href="http://example.com">Example</a> &middot; ';
echo '</p></div>';
}
@dky
dky / gist:5384394
Last active December 16, 2015 05:29
Genesis remove comments rss. Paste into functions.php
// Remove comments RSS feed
remove_filter('genesis_nav_items', 'genesis_nav_right', 10, 2);
remove_filter('wp_nav_menu_items', 'genesis_nav_right', 10, 2);
add_filter('genesis_nav_items', 'child_nav_right', 10, 2);
add_filter('wp_nav_menu_items', 'child_nav_right', 10, 2);
function child_nav_right($menu, $args) {
$args = (array)$args;
if ( !genesis_get_option('nav_extras_enable') || $args['theme_location'] != 'primary' )
return $menu;
@dky
dky / gist:5383362
Created April 14, 2013 16:45
Break out of SSH session in a zone
~~.
@dky
dky / gist:5383356
Created April 14, 2013 16:44
Escape key out of zone
~.
@dky
dky / gist:5302689
Last active December 15, 2015 18:19
Find commands for web content
find . -type d -print0 | xargs -0 chmod 775
find . -type d -print0 | xargs -0 chmod g+s
#Find all files with following extension and chmod them!
find . \( -name "*.png" -o -name "*.jpg" -o -name "*.gif" -o -name "*.php" -o -name "*.html" -o -name "*.pdf" -o -name "*.mp3" -o -name "*.js" -o -name "*.doc" -o -name "*.ico" -o -name "*.sql" \) -print0 | xargs -0 chmod 664
#Anything ! not
find . ! \( -name "*.png" -o -name "*.jpg" -o -name "*.gif" -o -name "*.php" -o -name "*.html" \) -print
@dky
dky / gist:5254552
Created March 27, 2013 14:25
Unhide ~/Library in OS 10.8
chflags nohidden ~/Library