Skip to content

Instantly share code, notes, and snippets.

View kenseii's full-sized avatar
🕸️
Downloading RAM

Agano oasis kenseii

🕸️
Downloading RAM
View GitHub Profile
@kenseii
kenseii / check_docker_container.sh
Created June 6, 2017 10:28 — forked from haukurk/check_docker_container.sh
Monitoring scripts for docker containers.
#!/bin/bash
# Author: Haukur Kristinsson / Erik Kristensen
# Email: haukur@hauxi.is / erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# The script checks if a container is running.
# OK - running
@kenseii
kenseii / Hot Reload JQUERY
Created August 9, 2017 21:19
use a div and a .get with jquery to get your data from another page on your website.
$(function() {
startRefresh();
});
function startRefresh() {
setTimeout(startRefresh,1000);
$.get('pagelink.php', function(data) {
$('#content_div_id').html(data);
});
}
@kenseii
kenseii / Readme.md
Created September 17, 2017 09:53 — forked from pdvyas/Readme.md
Sales Invoice REST API example

This example uses curl. You can use any other means of making http requests. Responses are in JSON format.

  • Login to frappe (and store cookies in a jar)
% curl https://demo.frappecloud.com/api/method/login -XPOST \-d "usr=demo%40frappecloud.com&pwd=demo" -c frappe.cookie   
{"message":"Logged In","full_name":"Demo User"}
  • Request for a Sales Invoice by id (output is piped to json pretty printer(optional))
@kenseii
kenseii / bitcoinRPC.py
Created November 6, 2017 17:37 — forked from ptabatt/bitcoinRPC.py
This is the backend for a Bitcoin RPC Plugin for the Web2py Framework
#!/usr/bin/env python
# coding: utf8
from gluon import *
from jsonrpc import ServiceProxy
import re
#access is a Server Proxy object between web2py and the command
#line program bitcoind using the session variables you supplied
#in the index page
@kenseii
kenseii / counter.exs
Created March 24, 2019 03:03
Elixir counting w,l,c
filename =
IO.gets("File to count the words from (h for help):\n")
|> String.trim
if filename == "h" do
IO.puts """
Usage: [filename] -[flags]
Flags
-l displays line count
-c displays character count
@kenseii
kenseii / jupyter_shortcuts.md
Created March 28, 2019 07:48 — forked from kidpixo/jupyter_shortcuts.md
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Toc

Keyboard shortcuts

The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border.

MacOS modifier keys:

  • ⌘ : Command
@kenseii
kenseii / .zshrc
Last active October 10, 2019 03:26
ubuntu .zshrc config
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/oasis/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# Basic Syntax
Introduction to Elixir https://www.youtube.com/watch?v=DltjeuB4Cu0
# Intermediate Syntax
Tutoriel Elixir : Découverte du langage Elixir https://www.youtube.com/watch?v=1hl_z9-QO9c
# Basics of OTP
The ABCs of OTP - Jesse J. Anderson https://www.youtube.com/watch?v=4SCwubzqsVU
@kenseii
kenseii / .zshrc
Created June 13, 2019 09:18
Mac .zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/oasis/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@kenseii
kenseii / feedback.py
Last active July 18, 2019 03:21
basic feedback aggregator using rpi
# import libraries and basic configs
import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library
GPIO.setwarnings(False) # Ignore warning for now
GPIO.setmode(GPIO.BOARD) # Use physical pin numbering
from influxdb import InfluxDBClient
import time
client = InfluxDBClient('localhost', 8086, 'root', 'root', 'customer_servicedb') # c$
# set good and bad pin