Skip to content

Instantly share code, notes, and snippets.

@Ttech
Ttech / irc-ident.cron.sh
Last active December 18, 2015 10:19
An automated away to allow identd ports for IRC use.
#!/bin/bash
# IRC IDENTD ALLOW RULES
# Generated on the fly...
# crontab recommended:
# 30 1 * * * /usr/bin/irc-ident.cron.sh
# which wil run daily at 1 30 in the morning
[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 / 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
<?php
/**
* Phergie
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.