Skip to content

Instantly share code, notes, and snippets.

View monitorFreeSpace.sh
#!/bin/sh
#
# � 2010 Western Digital Technologies, Inc. All rights reserved.
#
# monitorVolume.sh
# Note: this is called by cron
#
#
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
@jab416171
jab416171 / myuser.sls
Last active Aug 29, 2015
sls file for adding a user
View myuser.sls
myuser:
user:
- present
- uid: 1234
- gid: 1234
- remove_groups: False
- password: $6$asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
- shell: /bin/bash
- home: /home/myuser
- require:
View gist:1e64ed837a6224c00701
$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 63933
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
View speedtestcsv.sh
#!/bin/sh
filename=/tmp/speedtest_results
result=$(speedtest --simple)
download=$(echo $result | grep -oP "(?<=Download: )[0-9\.]* .*?/s")
upload=$(echo $result | grep -oP "(?<=Upload: )[0-9\.]* .*?/s")
ping=$(echo $result | grep -oP "(?<=Ping: )[0-9\.]* .*?ms")
if [ ! -e $filename ]; then
echo "\"Date\",\"Upload\",\"Download\",\"Ping\"" > $filename
fi
echo "\"$(date)\",\"$upload\",\"$download\",\"$ping\"" >> $filename
View problem.pl
#!/usr/bin/perl
sub foo(f)
a,b == 1,1
for i in range(f-1):
a,b = b,a+b
return str(a)
def bar(f:
if f=1 or f=2:
View gist:ef654f24bc5df5f14457
def insert_row(self, values, index=1):
""""Adds a row to the worksheet at the specified index and populates it with values.
Widens the worksheet if there are more values than columns.
:param values: List of values for the new row.
"""
self.add_rows(1)
data_width = len(values)
if self.col_count < data_width:
self.resize(cols=data_width)
View addToSpreadsheet
#!/usr/bin/env python
import gspread
import sys
import json
from oauth2client.client import SignedJwtAssertionCredentials
timestamp = sys.argv[1]
ping = sys.argv[2]
up = sys.argv[3]
down = sys.argv[4]
View contentscript.js
gcMessageDisplay.each(function(index, value) {
console.log("looping");
$('.next').eq(index).live('click', function() {
var parent = $(this).parent();
console.log(gcMessageDisplay);
console.log(index);
parent.html(gcMessageDisplay.eq(index+1));
});
});
View gist:1631027
E/keystore( 832): chdir: /data/misc/keystore: No such file or directory
E/installd( 831): Could not create directories; exiting.
D/AndroidRuntime( 830):
D/AndroidRuntime( 830): >>>>>> AndroidRuntime START com.android.internal.os.ZygoteInit <<<<<<
D/AndroidRuntime( 830): CheckJNI is OFF
E/dalvikvm( 830): Could not stat dex cache directory '/data/dalvik-cache': No such file or directory
I/dalvikvm( 830): Unable to open or create cache for /system/framework/core.jar (/data/dalvik-cache/system@framework@core.jar@classes.dex)
D/dalvikvm( 830): Unable to process classpath element '/system/framework/core.jar'
E/dalvikvm( 830): Could not stat dex cache directory '/data/dalvik-cache': No such file or directory
I/dalvikvm( 830): Unable to open or create cache for /system/framework/core-junit.jar (/data/dalvik-cache/system@framework@core-junit.jar@classes.dex)
View taskDetails.js
/* The Ti.API.log lines print "undefined", but the labels still show up with the correct data. How?
* Ti.API.log calls the native logcat for Android and iOS, I could just do an alert and get the same results. */
for(property in task) {
var labelName = Ti.UI.createLabel({
text:property
});
var labelValue = Ti.UI.createLabel({
text:task[property],
color:"#232323"
You can’t perform that action at this time.