Skip to content

Instantly share code, notes, and snippets.

View cprima's full-sized avatar

Christian Prior-Mamulyan cprima

  • Germany
View GitHub Profile
@underdoeg
underdoeg / readSMS.py
Created October 4, 2011 18:02
retreive sms via python, serial connection and AT commands
import serial
import time
from messaging.sms import SmsDeliver
ser=serial.Serial('/dev/ttyACM0', baudrate=9600, timeout=.1, rtscts=0)
def sendCommand(com):
ser.write(com+"\r\n")
time.sleep(2)
ret = []
@wtw
wtw / osx-settings.sh
Last active August 29, 2018 11:40 — forked from erikh/hack.sh
OSX Settings
#!/usr/bin/env sh
## Set some nice Mac OS system defaults
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@jmhobbs
jmhobbs / README.md
Last active January 2, 2019 15:51
Delayed queues for RQ.

Example Run

RQ Worker

✪ rqworker --db 10 default high
16:06:30 RQ worker started, version 0.3.7
16:06:30 
16:06:30 *** Listening on default, high...
16:06:49 high: jobs.multiply(5, 2) (2df52ba2-bd32-4849-a8e1-c5241c78b542)
16:06:49 Job OK, result = 10
@renoirb
renoirb / init.yml
Last active March 30, 2023 03:15
How to install Oracle Java from ppa webupd8team/java using Salt stack, in ONE state file
#
# How to install automatically Oracle Java 7 under Salt Stack
#
# Thanks Oracle for complicating things :(
#
# 1. Create a java/ folder in your salt master
# 2. Paste this file in init.sls
# 3. salt '*' state.sls java
#
# Source:
@nitoyon
nitoyon / rgb.go
Created January 1, 2016 16:08
Generate Animation GIF with Golang
package main
import (
"fmt"
"image"
"image/color"
"image/gif"
"math"
"os"
)
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@mihow
mihow / load_dotenv.sh
Last active July 16, 2024 13:19
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@pigeonhill
pigeonhill / LBS.lua
Last active June 12, 2023 16:15
LBS (CHDK)
--[[
Landscape Bracketing Script (LBS)
Capture 'perfect' focus brackets, with focus overlap defined in terms of defocus (CHDK) Circle of Confusion blur
Focus bracketing strategies are: current position to blur-defined infinity (X2INF); min camera focus to blur-defined infinity (Min2INF); H/x to infinity (H/x2INF);...
and Min focus to current focus position (Min2X).
Overlap, ie bracket to bracket, is definded in terms of the defocus (CoC) blur, eg CoC/2 means focus brackets 'touch' at a CHDK defocus blur of CoC/2.
@fonic
fonic / smart-status.sh
Created September 5, 2022 06:47
smart-status.sh - Query SMART status of disk drives (SSD/HDD) using smartctl
#!/usr/bin/env bash
# -------------------------------------------------------------------------
# -
# Fonic <https://github.com/fonic> -
# Date: 07/22/21 - 06/30/22 -
# -
# Based on: -
# Initramfs script 'initrc-init.sh', -
# 'man 8 smartctl', section 'EXIT STATUS' -
@cprima
cprima / README.md
Last active August 25, 2023 05:12
Turing Pi 2: On BMC host flash conveniently multiple CM4

init-nodes.sh

The init-nodes.sh script is a utility for the Turing Pi 2 to initialize and configure multiple CM4 nodes in a structured and automated manner. It operates by looping through specified node numbers, performing actions like copying configurations, power cycling, and more.

Prerequisites

  • Tested with BMC version 1.1.0 -- bug reports with older versions are welcome (see below).
  • The script requires sh.
  • It should be run with root permissions.
  • The image file to be flashed should be provided.