Skip to content

Instantly share code, notes, and snippets.

@jbek7
jbek7 / wget-jdk-oracle-install-example.txt
Created November 3, 2015 17:54 — forked from sr75/wget-jdk-oracle-install-example.txt
wget command to install Oracle JAVA JDK from stupid oracle website for centos and ubuntu
http://d.stavrovski.net/blog/post/how-to-install-and-setup-oracle-java-jdk-in-centos-6
# rpm
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm" \
-O jdk-7-linux-x64.rpm
# ubuntu
@jbek7
jbek7 / Vagrantfile
Last active November 10, 2015 18:19
Vagrant file for installing CentOS with JDK 1.7 & Maven 3.3
$script = <<SCRIPT
yum -y install git rpm rpm-build vim java-1.7.0-openjdk-devel
wget http://www.eu.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
tar -xvzf apache-maven-3.3.3-bin.tar.gz
#Add Maven to PATH
echo export PATH=/home/vagrant/apache-maven-3.3.3/bin:\$PATH >> /home/vagrant/.bashrc
#Replace settings.xml, uncomment below
@jbek7
jbek7 / 0_reuse_code.js
Created January 3, 2017 00:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
=== CLEAN TARGET MiniZip OF PROJECT Clutch WITH THE DEFAULT CONFIGURATION (Release) ===
Check dependencies
Clean.Remove clean build/Release-iphoneos/libMiniZip.a
builtin-rm -rf /Users/someUser/project/tweak/Clutch/build/Release-iphoneos/libMiniZip.a
Clean.Remove clean build/Clutch.build/Release-iphoneos/MiniZip.build
builtin-rm -rf /Users/someUser/project/tweak/Clutch/build/Clutch.build/Release-iphoneos/MiniZip.build
@jbek7
jbek7 / script.py
Last active February 5, 2019 00:52
Telegram Auto Replier
import time
from telethon import sync, TelegramClient, events
# sample API_ID from https://github.com/telegramdesktop/tdesktop/blob/f98fdeab3fb2ba6f55daf8481595f879729d1b84/Telegram/SourceFiles/config.h#L220
# or use your own
api_id =
api_hash = ''
# fill in your own details here
phone = '+yourphone'
@jbek7
jbek7 / playbook.yaml
Last active April 20, 2019 19:39
Ansible K8S ConfigMap generation
---
- name: Generate configmap k8s
template: src=templates/configmap.yaml dest=.k8s/configmap-output.yaml
vars:
- a_config_path: "config/a-config.yaml"
- b_config_path: "config/b-config.yaml"
- name: Apply configmap
k8s:
state: present
@jbek7
jbek7 / .k8s--configmap-output.yaml
Last active April 20, 2019 20:07
.k8s--configmap-output.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: my-configmap
data:
a-config.yaml: |
foo:
bar: {baz: qux, quux: quuz}
corge: grault
garply: waldo
@jbek7
jbek7 / a-config.yaml
Last active March 25, 2020 14:39
App configs
---
foo:
bar:
baz: qux
quux: quuz
corge: grault
garply: waldo
@jbek7
jbek7 / myfilter.py
Last active April 20, 2019 20:00
Custom Jinja filter for nice order preserved YAML
#!/usr/bin/python
import oyaml as yaml
import os
class FilterModule(object):
def filters(self):
return {
'to_yaml_preserve_order': self.to_yaml_preserve_order
}
---
apiVersion: v1
kind: ConfigMap
metadata:
creationTimestamp: null
name: my-configmap
data:
a-config.yaml: |
{{ a_config_path | to_yaml_preserve_order | indent }}
bconfig.yaml: |