Skip to content

Instantly share code, notes, and snippets.

View Kalvisan's full-sized avatar
🏠
Working from home

Kalvisan Kalvisan

🏠
Working from home
View GitHub Profile
@Kalvisan
Kalvisan / README.md
Last active July 31, 2018 11:28 — forked from lifehome/README.md
Cloudflare API v4 Dynamic DNS Update in Bash

Cloudflare DDNS bash client with systemd

This is a bash script to act as a Cloudflare DDNS client, useful replacement for ddclient.

How to use?

  1. Put the ddns.sh files to /root/
  2. chmod +x /root/ddns.sh
  3. Now you need to execute your script somehow: 4.1) Add script to CRONTAB job, to execute it every 1 hour.
  • At the end of file /etc/crontab add line: * */1 * * * root bash /root/ssh.sh 4.2) Or use /etc/rc.local file, who will execute script on startup
@Kalvisan
Kalvisan / git-update.sh
Created July 31, 2018 11:32
Super simple git auto updater script
#!/bin/bash
update() {
cd $1
STATUS="$(git pull)"
if [ "$STATUS" != "Already up-to-date." ] && [ "$STATUS" != "Already up to date." ]
then
echo "[$(/bin/date +%Y-%m-%d\ %H:%m)] $2 updated"
echo $STATUS
if [ "$3" != "" ]
@Kalvisan
Kalvisan / kiosk.sh
Created July 31, 2018 11:36
Script for opening Chromium browser in kiosk mode (fullscreen mode)
#!/bin/bash
# Tutorials:
# https://obrienlabs.net/setup-kiosk-ubuntu-chromium/
# https://askubuntu.com/questions/487488/how-to-open-chromium-in-full-screen-kiosk-mode-in-minimal-windows-manager-enviro
# Run this script in display 0 - the monitor
# export DISPLAY=:0
# Hide the mouse from the display
# unclutter &
@Kalvisan
Kalvisan / cloudflare-update.sh
Created February 15, 2019 23:35
Cloudflare API v4 updating DDNS using BASH and using multiple websites
#!/bin/bash
# CHANGE THESE
auth_email="YOUR_CLOUDFLARE_EMAIL"
auth_key="YOUR_CLOUDFLARE_API_KEY" # found in cloudflare account settings
# Usage: pages[<website_name>]="<record_name>"
declare -A pages
pages["example.com"]="record.example.com"
pages["example.net"]="example.net"
@Kalvisan
Kalvisan / fan-controller.sh
Created February 22, 2019 19:11
Super simple fan controller. I'm using WiringPI library for gpio command
#/bin/bash
MAX_TEMP=40
PIN=1
temp_mili=$(cat /sys/devices/virtual/thermal/thermal_zone0/temp)
temp=$((temp_mili/1000))
echo "Current temperature: ${temp}C"
echo "Given max temp value ${MAX_TEMP}C"
@Kalvisan
Kalvisan / FLKeyMini-MIDI-Web-Controller.tsx
Created May 4, 2025 18:21
Interactive FLKey Mini MIDI Controller Web Interface built with Next.js. Visually accurate layout with real-time MIDI feedback, supporting keys, pads, knobs, pitch/modulation, and transport controls. Includes live MIDI device connection status, velocity-based highlighting, and a floating debug log.
'use client';
import { useState, useEffect } from 'react';
export default function MidiPage() {
/*
* VARIABLES
* padColors: Array of background colors for 16 pads (purple for corners, cyan for others)
* blackKeyIdx: Array of indexes for black keys relative to white keys