Skip to content

Instantly share code, notes, and snippets.

View artynet's full-sized avatar

Arturo Rinaldi artynet

View GitHub Profile
#!/bin/bash
pip freeze | grep -v "^-e" | xargs pip uninstall -y
@artynet
artynet / build-curl-static.sh
Last active February 25, 2019 09:24
Build CUrl as a single static EXE
#!/bin/bash -x
### Build CURL as static binary ###
./configure --prefix=$HOME/.local \
--with-libmetalink \
--with-nghttp2 \
--disable-shared \
--enable-static \
--with-libssh2 \
@artynet
artynet / download-git-completion.sh
Last active August 27, 2019 14:57
quick git completion setup
#!/bin/bash -x
git_setup () {
cat << EOF
# git setup
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWCOLORHINTS=true
GIT_PS1_SHOWUNTRACKEDFILES=true
# ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
# sudo apt install ifupdown
#The loopback newtork interface
auto lo
iface lo inet loopback
# The primary network interface host-only adapter
#!/bin/bash -x
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3a%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk8-downloads-2133151.html; oraclelicense=accept-securebackup-cookie;" "$1"
@artynet
artynet / better-ssh-authorized-keys-management.md
Created December 10, 2018 15:59 — forked from sivel/better-ssh-authorized-keys-management.md
Better SSH Authorized Keys Management

Better SSH Authorized Keys Management

A seemingly common problem that people encounter is how to handle all of your users authorized_keys file.

People struggle over management, ensuring that users only have specific keys in the authorized_keys file or even a method for expiring keys. A centralized key management system could help provide all of this functionality with a little scripting.

One piece of functionality overlooked in OpenSSH is the AuthorizedKeysCommand configuration keyword. This configuration allows you to specify a command that will run during login to retrieve a users public key file from a remote source and perform validation just as if the authorized_keys file was local.

Here is an example directory structure for a set of users with SSH public keys that can be shared out via a web server:

@artynet
artynet / httpd
Created December 7, 2018 16:35 — forked from vittee/httpd
Apache 2.2 Init.d script for CentOS/RHEL
#!/bin/bash
#
# Startup script for the Apache Web Server
#
# chkconfig: - 85 15
# description: Apache is a World Wide Web server. It is used to serve \
# HTML files and CGI.
# processname: httpd
# pidfile: /usr/local/apache2/logs/httpd.pid
# config: /usr/local/apache2/conf/httpd.conf
@artynet
artynet / tomcat.sh
Created December 7, 2018 16:34 — forked from pecigonzalo/tomcat.sh
Tomcat Init Script (Centos/RHEL/Fedora)
#!/bin/bash
#
# tomcatd Start Tomcat server
#
# chkconfig: - 80 20
# description: Tomcat Web Application Server
#
# processname: tomcat
# pidfile: /var/run/tomcat.pid
@artynet
artynet / update-alternatives
Created July 31, 2018 13:28 — forked from mdevan/update-alternatives
update-alternatives commands for Oracle JDK 8u102
sudo update-alternatives --install /usr/bin/appletviewer appletviewer /usr/lib/jvm/jdk1.8.0_102/bin/appletviewer 180
sudo update-alternatives --install /usr/bin/extcheck extcheck /usr/lib/jvm/jdk1.8.0_102/bin/extcheck 180
sudo update-alternatives --install /usr/bin/idlj idlj /usr/lib/jvm/jdk1.8.0_102/bin/idlj 180
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.8.0_102/bin/jar 180
sudo update-alternatives --install /usr/bin/jarsigner jarsigner /usr/lib/jvm/jdk1.8.0_102/bin/jarsigner 180
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_102/jre/bin/java 180
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8.0_102/bin/javac 180
sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk1.8.0_102/bin/javadoc 180
sudo update-alternatives --install /usr/bin/javafxpackager javafxpackager /usr/lib/jvm/jdk1.8.0_102/bin/javafxpackager 180
sudo update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/jdk1.8.0_102/bin/javah 1
@artynet
artynet / jinfo
Created July 31, 2018 13:28 — forked from mdevan/jinfo
/usr/lib/jvm/.jdk1.8.0_102.jinfo file for Oracle JDK 8u102
name=jdk1.8.0_102
alias=oracle-jdk1.8
priority=180
section=main
hl rmid /usr/lib/jvm/jdk1.8.0_102/jre/bin/rmid
hl java /usr/lib/jvm/jdk1.8.0_102/jre/bin/java
hl keytool /usr/lib/jvm/jdk1.8.0_102/jre/bin/keytool
hl pack200 /usr/lib/jvm/jdk1.8.0_102/jre/bin/pack200
hl rmiregistry /usr/lib/jvm/jdk1.8.0_102/jre/bin/rmiregistry