Skip to content

Instantly share code, notes, and snippets.

johackim

View GitHub Profile
View mediaqueries.css
/* Mobile */
@media only screen and (max-width: 767px) {
[class*="mobile hidden"],
[class*="tablet only"]:not(.mobile),
[class*="computer only"]:not(.mobile),
[class*="large screen only"]:not(.mobile),
[class*="widescreen only"]:not(.mobile),
[class*="or lower hidden"] {
display: none !important;
}
@johackim
johackim / dashboard.sh
Last active Feb 13, 2018
Rasbperry dashboard script install
View dashboard.sh
#!/bin/bash
if [ "$(whoami)" != "root" ]; then
echo "$0: Permission denied"
exit 1;
fi
# Install dependencies
sudo apt-get update
sudo apt-get install -y i3 dmenu rxvt-unicode xorg xinit xdotool surf
@johackim
johackim / install.sh
Created Jan 29, 2018
Kubernetes installation
View install.sh
#!/bin/sh
export DEBIAN_FRONTEND=noninteractive;
if [ "$(whoami)" != "root" ]; then
echo "$0: Permission denied"
exit 1;
fi
# Install kubeadm
if [ -z "$(command -v kubeadm)" ]; then
View disable-webcam.sh
#!/bin/bash
sudo modprobe -r uvcvideo
echo 'blacklist uvcvideo' | sudo tee -a /etc/modprobe.d/blacklist.conf
View matomo.sh
touch /var/www/html/config/config.ini.php;
php /var/www/html/console config:set --section="database" --key="host" --value=$MYSQL_HOST;
php /var/www/html/console config:set --section="database" --key="port" --value="3306";
php /var/www/html/console config:set --section="database" --key="username" --value="root";
php /var/www/html/console config:set --section="database" --key="password" --value=$MYSQL_ROOT_PASSWORD;
php /var/www/html/console config:set --section="database" --key="dbname" --value="matomo";
curl -s -o db_seed.sql https://git.cloudron.io/cloudron/matomo-app/raw/master/db_seed.sql;
apt-get update && apt-get install -y mysql-client;
cat db_seed.sql | mysql -uroot -p$MYSQL_ROOT_PASSWORD -h $MYSQL_HOST -P 3306 "matomo";
chmod -R 777 /var/www/html/tmp/cache/;
View dyndns.sh
#!/bin/bash
DYNHOST_USER="my username"
DYNHOST_PASSWD="my password"
DYNHOST_DOMAINS=(mydomain.com mydomain2.com)
OVH_URL="https://www.ovh.com/nic/update?system=dyndns"
for DYNHOST_DOMAIN in ${DYNHOST_DOMAINS[@]}; do
curl --user "$DYNHOST_USER:$DYNHOST_PASSWD" "${OVH_URL}&hostname=${DYNHOST_DOMAIN}"
done
View keybase.md

Keybase proof

I hereby claim:

  • I am ston3o on github.
  • I am ston3o (https://keybase.io/ston3o) on keybase.
  • I have a public key whose fingerprint is E6E5 14AD F298 493D 3B54 8836 CF53 E458 B82F 3538

To claim this, I am signing this object:

View pptpd.conf
# Install pptpd
apt-get install pptpd
# /etc/pptpd.conf
localip 10.0.0.1
remoteip 10.0.0.100-200
# /etc/ppp/chap-secrets
# Secrets for authentication using PAP
# client server secret acceptable local IP addresses
View nginx
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@johackim
johackim / iframe.js
Last active Jul 21, 2017
iframe defer
View iframe.js
// <iframe src="" frameborder="0" data-src="http://website.com"></iframe>
window.onload = () => {
const defer = document.getElementsByTagName('iframe');
for (let i = 0; i < defer.length; i += 1) {
if (defer[i].getAttribute('data-src')) {
defer[i].setAttribute('src', defer[i].getAttribute('data-src'));
}
}
};
You can’t perform that action at this time.