Skip to content

Instantly share code, notes, and snippets.

View sytone's full-sized avatar
🎯
Focusing

Sytone sytone

🎯
Focusing
View GitHub Profile
@sytone
sytone / JasperOnPiNotes.txt
Last active March 3, 2016 16:05
Get Jasper running on PI
#Set sound card to my USB one by default.
sudo nano /etc/modprobe.d/alsa-base.conf
:: ADD to FILE
options snd-usb-audio index=0
options snd_bcm2835 index=1
# Audio record test.
arecord --vumeter=stereo test2.wav --device=sysdefault:CARD=HD5000
@sytone
sytone / LinuxOnPiNotes.txt
Created February 27, 2016 17:41
Generic Linux on Pi things
Using Putty or Kitty and getting lines to draw.
The problem is that PuTTY in UTF-8 mode ignores1 VT100 "Alternate character set" commands, and ncurses attempts to use the "graphical" character set for drawing the GUI. (The box drawing characters are in the same positions as klmqx would normally be.)
export NCURSES_NO_UTF8_ACS=1
to your environment, it should fix the problem by telling ncurses to always use Unicode box drawing characters when a UTF-8 locale is selected.
@sytone
sytone / SqueezeboxPlayerNotes.txt
Last active May 24, 2016 04:28
Raspberry Pi as a Squeezebox Player
# Sound test setup
aplay -L
speaker-test -D sysdefault:CARD=Device
amixer
# Get out of jail free card
# sudo /etc/init.d/alsa-utils reset
# alsa configuration
sudo nano /usr/share/alsa/alsa.conf
/lib/modprobe.d/aliases.conf
@sytone
sytone / Get-DhcpLog.ps1
Last active December 27, 2015 19:21
Returns the DHCP list for a ASUS router.
$username = "admin"
# read-host -assecurestring | convertfrom-securestring | out-file .\securestring.txt
$password = cat .\securestring.txt | convertto-securestring
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
$page = Invoke-WebRequest -Uri "http://192.168.0.1/Main_DHCPStatus_Content.asp" -Credential $cred
$dhcpList = $page.AllElements | where tagName -eq "textarea" | Select -First 1 -ExpandProperty innerText
$rows = @()
$dhcpList.split("`n")[(1..($dhcpList.split("`n").Length-1))] | % {
$row = $_.split(" ",[StringSplitOptions]'RemoveEmptyEntries')
[PSCustomObject]@{
initctl list | egrep -v " stop/waiting|^tty" ; service --status-all 2>&1 | egrep -v "\[ (\?|\-) \]"

##Introduction Basicly a step by step plan to install OpenHAB 1.7.1 on a debian instance using the following bindings. The content is mostly copy&paste from the OpenHAB wiki:

Operating System

I used to run OpenHAB 1.x on Windows, because of other services, but Debian should work fine. Install debian, nuf said.

@sytone
sytone / gist:ff027ac328c4790e0cf2
Last active November 23, 2015 23:31
Node JS Setup
sudo apt-get install -y nodejs
sudo apt-get install -y build-essential
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo apt-get install samba
sudo smbpasswd -a user
mkdir nodejs
cd nodejs
mkdir entrance
sudo nano /etc/samba/smb.conf
@sytone
sytone / HomeAutoNode.ino
Created November 4, 2015 01:52
Arduino Code for Garage Node
/*
This proram is for a node that is always powered, do not
use this if you want a low powered node on your network.
This node will be subscribing and listening for MQTT
messages all the time and also sending out messages
when state changes occur.
*/
@sytone
sytone / pihacks
Last active October 16, 2022 20:14
Pi hacks
# http://raspberrypi.stackexchange.com/questions/169/how-can-i-extend-the-life-of-my-sd-card
# http://www.a-netz.de/2013/02/ramdisks-for-the-raspberry/
# http://web.archive.org/web/20140701023126/http://raspberry.pi.gw.gd/t50-Using-ZRAM.html
#zram
sudo modprobe zram zram_num_devices=1
lsmod | grep zram
Script Contents:
#!/bin/sh -e
@sytone
sytone / phpfm.php
Created February 20, 2015 22:54
phpFileManager - http://phpfm.sf.net
<?php
//a:9:{s:4:"lang";s:2:"en";s:9:"auth_pass";s:32:"d41d8cd98f00b204e9800998ecf8427e";s:8:"quota_mb";i:0;s:17:"upload_ext_filter";a:0:{}s:19:"download_ext_filter";a:0:{}s:15:"error_reporting";i:1;s:7:"fm_root";s:0:"";s:17:"cookie_cache_time";i:2592000;s:7:"version";s:5:"0.9.8";}
/*--------------------------------------------------
| PHP FILE MANAGER
+--------------------------------------------------
| phpFileManager 0.9.8
| By Fabricio Seger Kolling
| Copyright (c) 2004-2013 Fabrício Seger Kolling
| E-mail: dulldusk@gmail.com
| URL: http://phpfm.sf.net