Skip to content

Instantly share code, notes, and snippets.

@kainlite
kainlite / gist:f0a484a48a103cc031985cea5353ba83
Created June 27, 2017 14:15 — forked from jtimberman/gist:639638
different ways to get interface IPs
$ grep 'node\[:network\]\[:interfaces\].' \#chef.log
10:15 < mkent_> node[:network][:interfaces][:eth1][:addresses]
22:24 <+Damm> msf, just pulling in the node[:network][:interfaces] attributes
20:44 < randybias> node[:network][:interfaces][:eth0][:addresses]
09:13 < sinBot> so fujin if I wanted to use that in an erb template, it'd be <%= @node[:network][:interfaces]["en1"]["addresses"].select{address}.flatten.to_str %> ?
12:27 < cwj> if i have an ipv4 ip address set on eth0, will it always be in @node[:network][:interfaces][:eth0][1] ?
02:19 < pluesch0r> however, i don't seem to be able to access @node[:network][:interfaces]... from inside the attributes file.
19:52 <@jtimberman> or node[:network][:interfaces][:eth0][:addresses][0]
20:09 < seryl> well, it's searchable. I'm trying the @node[:network][:interfaces][:eth0][:addresses][0] route, but getting blanks right now, playing around with it in chef solo
20:29 < kallistec> pp node[:network][:interfaces].current_attribute
@kainlite
kainlite / ml.html
Created July 28, 2017 14:40
Exploring ML API
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://secure.mlstatic.com/sdk/javascript/v1/mercadopago.js"></script>
<script>
$(document).ready ( function(){
function getIdentificationType(status, response) {
if (status == 200) {
console.log("Identification type:");
console.log(response);
@kainlite
kainlite / mp2.html
Created July 29, 2017 22:29
MercadoPago Card Token
<html>
<head>
<script src="https://secure.mlstatic.com/sdk/javascript/v1/mercadopago.js"></script>
</head>
<body>
<form action="" method="post" id="pay" name="pay" >
<fieldset>
<ul>
<li>
@kainlite
kainlite / nginx-nextcloud.conf
Created September 1, 2017 01:08
nginx-nextcloud.conf
upstream php-handler {
server 127.0.0.1:9000;
}
server {
listen 80;
@kainlite
kainlite / meraki-client-vpn-linux.md
Created May 21, 2018 21:20 — forked from clivetyphon/meraki-client-vpn-linux.md
Configuring Meraki Client VPN in Linux

Configuring Meraki Client VPN in Linux

You can try the official Meraki Configuring Client VPN in Linux article for GUI based setup. For terminal based configuration, see below.

Install packages

Install the following packages:

  • strongswan
  • xl2tpd
~ kubectl get pods
NAME READY STATUS RESTARTS AGE
mongo-config-0 1/1 Running 0 3d
mongo-config-1 1/1 Running 0 3d
mongo-config-2 1/1 Running 0 3d
mongo-qr-flmls 1/1 Running 0 3d
mongo-qr-mbgdw 1/1 Running 0 3d
mongo-qr-s2rvm 1/1 Running 0 3d
mongo-shard0-0 1/1 Running 0 3d
mongo-shard0-1 1/1 Running 0 3d
@kainlite
kainlite / terraform-remote-exec
Created November 16, 2018 20:42 — forked from afritzler/terraform-remote-exec
Terraform remote-exec cloud-init fix
provisioner "remote-exec" {
inline = [
"while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done"
]
}
techsquad.rocks. 300 IN A 185.199.110.153
techsquad.rocks. 300 IN A 185.199.111.153
techsquad.rocks. 300 IN A 185.199.108.153
techsquad.rocks. 300 IN A 185.199.109.153
hugo new site testing-hugo
# OUTPUT:
# Congratulations! Your new Hugo site is created in /home/kainlite/Webs/testing-hugo.
#
# Just a few more steps and you're ready to go:
#
# 1. Download a theme into the same-named folder.
# Choose a theme from https://themes.gohugo.io/, or
# create your own with the "hugo new theme <THEMENAME>" command.
# 2. Perhaps you want to add some content. You can add single files
#!/bin/bash
COMMIT_MESSAGE=`git log -n 1 --pretty=format:%s ${local_ref}`
hugo -d ~/Webs/kainlite.github.io
ANYTHING_CHANGED=`cd ~/Webs/kainlite.github.io && git diff --exit-code`
if [[ $? -gt 0 ]]; then
cd ~/Webs/kainlite.github.io && git add . && git commit -m "${COMMIT_MESSAGE}" && git push origin master