For educational reasons I've decided to create my own CA. Here is what I learned.
Lets get some context first.
#!/bin/bash | |
formulas="sudoers timezone ntp openssh resolver iptables salt systemd users vim rsyslog logrotate vsftpd apt locale epel firewalld golang snmp iscsi lvm rsyncd sysctl zabbix dnsmasq haproxy keepalived docker nginx php postfix chrony letsencrypt libvirt nfs powerdns varnish redmine zookeeper postgres mysql kibana openvpn collectd apache tomcat etcd consul memcached django openvswitch bind ufw mongodb elasticsearch fail2ban vault prometheus node" | |
BASE_DIR=/srv | |
formula_root=$BASE_DIR/formulas | |
state_root=$BASE_DIR/states | |
pillar_root=$BASE_DIR/pillars | |
# git use git/https | |
[email protected]:saltstack-formulas |
#!/bin/bash | |
vim-cmd vmsvc/getallvms | grep -i hostname | cut -d ' ' -f 1 | xargs vim-cmd vmsvc/get.guest | grep ipAddress | sed -n 1p | cut -d '"' -f 2 | |
# or | |
ssh esxi.example.com /bin/vim-cmd vmsvc/get.guest $(ssh esxi.example.com /bin/vim-cmd vmsvc/getallvms | grep -i hostname | cut -d ' ' -f 1) | grep ipAddress | sed -n 1p | cut -d '"' -f 2 |
Simple multimedia streams analyzer | |
usage: ffprobe [OPTIONS] [INPUT_FILE] | |
Main options: | |
-L show license | |
-h topic show help | |
-? topic show help | |
-help topic show help | |
--help topic show help | |
-version show version |
Add config/puma.ruby | |
-------------------- | |
cd /home/redmine/redmine | |
sudo -u redmine -H curl --output config/puma.rb https://gist.github.com/thanhhh/5610668/raw/fdfe2a865c3a0afe912c8784c971ea7ca3e64cfd/puma.rb | |
Install Init Script | |
-------------------- | |
Download the init script (will be /etc/init.d/redmine): | |
There is a lot of buzz around neural-nets and how cool they are for image-recognition and text-recognition. There are a lot of sources out there to learn tensorflow and their application to solve these set of problems.
I'd reommend a course offered by Google on Udacity which teaches all about this stuff: https://classroom.udacity.com/courses/ud730.
This course doesn't cover the details of mathematics behind neural-nets and so doesn't this gist. However, the instructors do go into the intuition, breaking down a complex problem like visual recognition into abstract concepts and writing a program to predict some tensors and ultimately those concepts.
Through this gist I've tried to cover a very basic introduction to the tensorflow framework, the data structures it uses and it's application in a predictive-text model.
import subprocess | |
import datetime | |
import numpy as np | |
THREAD_NUM=4 | |
def get_video_info(fileloc) : | |
command = ['ffprobe', | |
'-v', 'fatal', | |
'-show_entries', 'stream=width,height,r_frame_rate,duration', |
Concurrency is a domain I have wanted to explore for a long time because the locks and the race conditions have always intimidated me. I recall somebody suggesting concurrency patterns in golang because they said "you share the data and not the variables".
Amused by that, I searched for "concurrency in golang" and bumped into this awesome slide by Rob Pike: https://talks.golang.org/2012/waza.slide#1 which does a great job of explaining channels, concurrency patterns and a mini-architecture of load-balancer (also explains the above one-liner).
Let's dig in:
#!/bin/sh | |
# example: sh delete_es_by_day.sh logstash-kettle-log logsdate 30 | |
index_name=$1 | |
daycolumn=$2 | |
savedays=$3 | |
format_day=$4 | |
if [ ! -n "$savedays" ]; then | |
echo "the args is not right,please input again...." |
// --- Compiling --- | |
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz | |
$ tar xzvf redis-2.8.3.tar.gz | |
$ cd redis-2.8.3 | |
$ make | |
$ make install | |
// --- or using yum --- | |
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm |