Skip to content

Instantly share code, notes, and snippets.

View NetworksAreMadeOfString's full-sized avatar

Gareth NetworksAreMadeOfString

View GitHub Profile
Oct 22 11:07:54 el330 kernel: [73251.488698] usb 9-1: new full-speed USB device number 12 using xhci_hcd
Oct 22 11:07:54 el330 kernel: [73251.526454] usb 9-1: New USB device found, idVendor=1050, idProduct=0120
Oct 22 11:07:54 el330 kernel: [73251.526460] usb 9-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Oct 22 11:07:54 el330 kernel: [73251.526463] usb 9-1: Product: Security Key by Yubico
Oct 22 11:07:54 el330 kernel: [73251.526466] usb 9-1: Manufacturer: Yubico
Oct 22 11:07:54 el330 kernel: [73251.536699] hid-generic 0003:1050:0120.0060: hiddev0,hidraw4: USB HID v1.10 Device [Yubico Security Key by Yubico] on usb-0000:01:00.0-1/input0
Oct 22 11:07:54 el330 mtp-probe: checking bus 9, device 12: "/sys/devices/pci0000:00/0000:00:02.0/0000:01:00.0/usb9/9-1"
Oct 22 11:07:54 el330 mtp-probe: bus: 9, device: 12 was not an MTP device
Oct 22 11:07:54 el330 gnome-session[1591]: [10397:10430:1022/110754:ERROR:hid_service_linux.cc(166)] Cannot open '/dev/hidraw4': FILE_ERROR_ACCESS_DENIED
Oct 22 11:08:12
@NetworksAreMadeOfString
NetworksAreMadeOfString / gist:11381597
Created April 28, 2014 19:24
Output of running 'show version' on a Cisco 1841 router running IOS Version 12.4(13r)T
Cisco IOS Software, 1841 Software (C1841-ADVIPSERVICESK9-M), Version 12.4(9)T5, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Thu 16-Aug-07 14:30 by prod_rel_team
ROM: System Bootstrap, Version 12.4(13r)T, RELEASE SOFTWARE (fc1)
RTR-CS-B uptime is 9 hours, 12 minutes
System returned to ROM by power-on
System image file is "flash:c1841-advipservicesk9-mz.124-9.T5.bin"
javax.servlet.ServletException: Servlet.init() for servlet api-controller threw exception
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
yum install mongo-stable mongo-stable-server mongo-stable-debuginfo
chkconfig --levels 235 mongod on
/etc/init.d/mongod start
wget http://www.ubnt.com/downloads/unifi/2.3.8/UniFi.unix.zip
unzip UniFi.unix.zip
mv UniFi /usr/
#!/bin/bash
# chkconfig: 2345 95 20
# description: UniFi system
# processname: UniFi
ctrl_start()
{
#nohup java -jar JarFile.jar </dev/null >>myLogFile 2>>myErrorFile&
java -jar /usr/UniFi/lib/ace.jar start &
}
@NetworksAreMadeOfString
NetworksAreMadeOfString / AAR Example.java
Created February 2, 2013 15:40
A very basic (no real error handling / tag formatting etc) example of writing Android Application Records
public void onNewIntent(Intent intent)
{
Tag tagFromIntent = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
WriteTag(tagFromIntent);
}
public void WriteTag(final Tag receivedTag)
{
((Thread) new Thread()
{
<receiver android:name="net.networksaremadeofstring.zeus.ZeusHalogenWidget" android:label="Zeus Halogen Widget">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="@xml/widget" />
</receiver>
@NetworksAreMadeOfString
NetworksAreMadeOfString / widget.xml
Created January 6, 2013 21:18
Zeus Widget definition
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="32dp"
android:minHeight="32dp"
android:updatePeriodMillis="86400000"
android:initialLayout="@layout/widget2"
android:resizeMode="horizontal|vertical"
android:widgetCategory="home_screen|keyguard">
</appwidget-provider>
<?php
require_once 'common.php';
$DEVICEID = $_GET['deviceid'];
$consumer = new HTTP_OAuth_Consumer(constant('PUBLIC_KEY'), constant('PRIVATE_KEY'), 'XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXX');
$params = array(
'supportedMethods' => constant('TELLSTICK_TURNON') | constant('TELLSTICK_TURNOFF'),
'id' => $DEVICEID,
'response' => 'json'
);
$response = $consumer->sendRequest(constant('REQUEST_URI').'/device/turnOn', $params, 'GET');
@NetworksAreMadeOfString
NetworksAreMadeOfString / TelldusProxy.java
Created January 6, 2013 21:12
A quick example of calling the proxy
public static void switchSomething(final int ID, final boolean toggle)
{
((Thread) new Thread()
{
public void run()
{
try
{
DefaultHttpClient client = new DefaultHttpClient();
HttpParams params = new BasicHttpParams();