Skip to content

Instantly share code, notes, and snippets.

[Unit]
Description=Linode Longview
After=syslog.target network.target
[Service]
Type=forking
PIDFile=/run/longview.pid
ExecStart=/opt/linode/longview/Linode/Longview.pl
[Install]
@Ttech
Ttech / info.sh
Last active February 14, 2018 22:45
#!/bin/bash
function dagd {
if [ $1 -eq '-6' ]; then
curl -m 2 -s "http://da.gd/$2"
else
curl -m 2 -s -4 "http://da.gd/$2?strip"
fi
}
function remote_network {
# set some magical temporary stuff
@Ttech
Ttech / gist:5625307
Last active December 17, 2015 14:29
raw_interfaces=$(ifconfig |
perl -ane '
END{print "\042", join("\042 \042", @a), "\042\n"}
$a[$c++] = $1 if /^(\w+)/;
')
interfaces=($raw_interfaces)
for interface in "${interfaces[@]}"
do
address=$(ifconfig `echo $interface | sed "s/\"//g"` | grep inet)
if [ $? -eq 0 ]; then
#!/bin/bash
# add to the shared library search path
export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/usr/lib
CONF_DIRECTORY=/etc/wview
RUN_DIRECTORY=/var/wview
WVIEW_INSTALL_DIR=/usr/bin
### BEGIN INIT INFO
# Provides: wview
# Required-Start: $local_fs $network $time $syslog
/var/log/remote/*/*.log {
missingok
daily
rotate 1
ifempty
create 0600 root root
copytruncate
compress
}
#!/bin/bash
echo "----------------------"
date
temp=$(/opt/vc/bin/vcgencmd measure_temp | awk -F"=" '{print $2}' | awk -F"'" '{print $1}')
echo "temp.value $temp"
for volt in core sdram_c sdram_i sdram_p
do
voltage=$(/opt/vc/bin/vcgencmd measure_volts $volt | awk -F"=" '{print $2}' | tr -d "V")
echo "volt$volt.value $voltage"
done
<?php
function better_parse_ini_file($filename){
$ini_array = array();
if(file_exists($filename)){
$file_contents = file_get_contents($filename);
} else {
return false;
}
// we will now process the file
High Altitude Weather Balloon - Pi Edition
------------------------------------------------------------------------------------
Sensors:
------------------------------------------------------------------------------------
MPU6050 - Provides 3 Axis Accelerometer, 3 Axis Gyro, Thermometer
SEN-11282 - Provides Barometric Pressure Temperature Altitude Sensing
UM96 - Provides Serial, data transfer (replace with audio out from pi)
Parallax GP - Provides Time, Provides Elevation, Provides Location
CMOS IR CAM - Provides Camera Capabilities (Find better?)
------------------------------------------------------------------------------------
RX bytes:282576444 (269.4 MiB) TX bytes:300322516 (286.4 MiB)
RX bytes:245801472 (234.4 MiB) TX bytes:22882002 (21.8 MiB)
RX bytes:4660828 (4.4 MiB) TX bytes:4660828 (4.4 MiB)
10:29:14 up 1 day, 15:15, 1 user, load average: 0.16, 0.28, 0.37
@Ttech
Ttech / wol.sh
Created November 22, 2012 21:40
Wake On Lan Launcher
#!/bin/bash
lease_file="/var/lib/dhcp/dhcpd.leases"
function get_client_name(){
ip=$1
client=`cat $lease_file|grep -A 12 $ip|grep client|uniq|sed -e "s/^.*\"\(.*\)\".*$/\1/"`
if [ ! "$client" = "" ]; then
echo "$client"
else