Skip to content

Instantly share code, notes, and snippets.

View Tomin1's full-sized avatar

Tomi Leppänen Tomin1

View GitHub Profile
@Tomin1
Tomin1 / config.lua
Last active October 18, 2018 14:39
NodeMCU DS18B20 station
-- Use this to configure NodeMCU to connect your AP
local STATION_CONFIG = {}
STATION_CONFIG.ssid = "my ssid"
STATION_CONFIG.pwd = "my password"
STATION_CONFIG.auto = true
STATION_CONFIG.save = true
wifi.setmode(wifi.STATION)
wifi.sta.config(STATION_CONFIG)
@Tomin1
Tomin1 / reorder.py
Created January 8, 2018 20:15
reordering scripts
#!/usr/bin/env python3
# Public domain
import argparse
import os
import os.path
import shutil
import sys
def reorder(directory, sorted_, recurse, verbose):
@Tomin1
Tomin1 / LUEMINUT
Last active September 7, 2016 19:05
Elisa skriptejä
Elisa Viihde -skriptejä
=======================
Erilaisia skriptejä Elisa Viihteen käyttöön. Laita kaikki skriptit `/usr/local/bin`-hakemistoon ja anna niille suoritusoikeudet (`chmod +x`).
`elisa_url.py` on Python-skripti, joka hakee videotiedoston url-osoitteen annetun sivun url-osoitteen perusteella. Sitä käytetään yleensä osana jotain muuta skriptiä, kuten tässä olevat bash-skriptit.
`elisa_latain.sh` on bash-skripti, joka lataa videon annetun URL-osoitteen perusteella annettuun hakemistoon käyttäen `elisa_url.py`:tä ja `wget`:iä. Sitä käytetään antamalla toiseksi viimeiseksi parametriksi videon sivun osoite ja viimeiseksi kohdetiedosto. Muut parametrit annetaan suoraan `wget`:lle.
`elisa_katso.sh` on bash-skripti, joka toistaa videon VLC-soittimella ladaten sitä samaan aikaan `wget`:llä. Se käyttää `elisa_url.py`:tä ja myös `inotifywait`:iä, mikäli se on käytettävissä. Videon katselun päätyttyä eli kun VLC suljetaan, video poistetaan koneelta. Oletus tallennuspaikka on `/tmp`-hakemistossa, mutta sit
@Tomin1
Tomin1 / gist:1c7cb530413a56959508
Last active August 29, 2015 14:14
kernels.sh
#!/bin/sh
# This script is made by Tomi Leppänen aka Tomin (http://tomin.dy.fi/)
# You are free to use, copy, redistribute and modify this script
# as long as you accept that ***I won't take any responsibility
# for this code and it comes without any warranty***
# This script downloads Kernel.org webpage and prints out a table
# of latest Linux releases
KERNEL_ORG=www.kernel.org
#!/bin/sh
# This script is made by Tomi Leppänen aka Tomin (http://tomin.dy.fi/)
# You are free to use, copy, redistribute and modify this script
# as long as you accept that ***I won't take any responsibility
# for this code and it comes without any warranty***
# This script works as pastebincl would but it takes the URL from
# the output of pastebincl and pastes it to clipboard.
# It is recommended to alias this script to some better name
@Tomin1
Tomin1 / scrottaa.sh
Last active September 21, 2018 19:37
An easy way to take a screenshot and share it
#!/bin/sh
# This script is made by Tomi Leppänen aka Tomin (http://tomin.site/)
# You are free to use, copy, redistribute and modify this script
# as long as you accept that ***I won't take any responsibility
# for this code and it comes without any warranty***.
# This script takes a screenshot from the part of screen that you can
# select by mouse and then it saves the screenshot to your Dropbox
# folder (location set by DIRECTORY variable) and then pastes a shared
# link to clipboard.