This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
def enable_gpus(device_type, use_cpus=False): | |
preferences = bpy.context.preferences | |
cycles_preferences = preferences.addons["cycles"].preferences | |
cuda_devices, opencl_devices = cycles_preferences.get_devices() | |
if device_type == "CUDA": | |
devices = cuda_devices | |
elif device_type == "OPENCL": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"next":"Samedi 15 Septembre, 11h à Saint-Brès et 15h à Grabels" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
load=`cat /proc/loadavg | awk '{print $1}'` | |
mem=`free -o | awk 'NR==2{print $3}'` | |
echo '{"version": "1.1","host":"'$HOSTNAME'","short_message":"cpumem","level":4,"_load":'$load',"_mem":'$mem'}' | nc -c -w1 -u graylog.server 12201 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IP=`/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'` | |
MSG=\{\"short_message\":\"heartbeat\",\"host\":\"host\",\"address\":\"$IP\"\} | |
curl -XPOST http://gelf.logging.com/gelf -p0 -d $MSG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
IP=`ip -f inet -o address show enp1s0f0 | awk '{print $4}'` | |
echo '{"version": "1.1","host":"'$HOSTNAME'","short_message":"ip","level":4,"_ip":"'$IP'"}' | nc -w 1 -u <server_address> 12201 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function requestHandler(request, response) { | |
try { | |
if ("color" in request.query) { | |
local ledState = request.query.color.tointeger(); | |
local sleep=10; | |
if ("sleep" in request.query){ | |
sleep = request.query.sleep.tointeger(); | |
} | |
params<-{"color":ledState,"sleepTime":sleep}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#from http://www.ubuntugeek.com/ubuntu-tiphowto-reduce-adobe-acrobat-file-size-from-command-line.html | |
$ gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.akeric.com/blog/?p=1352 | |
$ ant build | |
$ jarsigner -verbose -keystore ~/my-release-key.keystore `pwd`/bin/MucemApp-release-unsigned.apk davidonet | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
Process proc = Runtime.getRuntime().exec(new String[] { | |
"su", "-c", "service call activity 79 s16 com.android.systemui" | |
} | |
); | |
try | |
{ | |
proc.waitFor(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://stackoverflow.com/questions/5109988/is-there-a-way-to-hide-the-system-bar-in-android-3-0-its-an-internal-device-an | |
To stop/remove/disable the system bar (need to be su before issuing this command): | |
$ service call activity 79 s16 com.android.systemui | |
To restore the system bar just simply issue this command: | |
$ am startservice -n com.android.systemui/.SystemUIService |
NewerOlder