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 | |
export PATH=/home/agu/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin:$PATH | |
/home/agu/tools/eclipse-cdt/eclipse |
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 | |
tmpfile=/tmp/$$.txt | |
iconv -f cp936 -t utf-8 $1 > $tmpfile | |
mv $tmpfile $1 |
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/zsh | |
curl -s "https://octodex.github.com/" | grep "<img.*data-src" | grep -o "/image[^\"]*" | while read line; do | |
wget 'https://octodex.github.com'$line | |
done |
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
#include <cstdio> | |
#include <cstdlib> | |
int compare (const void * a, const void * b) { | |
return ( *(int*)b - *(int*)a ); | |
} | |
void max(int *buff, int length, int * p1, int *p2) { | |
qsort(buff, length, sizeof(int), compare); | |
*p1 = buff[0]; |
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
#!/usr/bin/env python | |
import sys | |
import os | |
import cx_Oracle | |
reload(sys) | |
sys.setdefaultencoding('utf-8') | |
os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.AL32UTF8' |
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
package demo; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import processing.core.PApplet; | |
import processing.core.PVector; | |
import demo.DmPoint; |
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
const int pingTrig = 9; // transmission pin | |
const int pingEcho = 8; //receiving pin | |
void setup() { | |
// initialize serial communication: | |
Serial.begin(9600); | |
pinMode(pingTrig, OUTPUT); | |
pinMode(pingEcho, INPUT); | |
} |
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
//============================================================================ | |
// Name : socket_demo.cpp | |
// Author : aGuegu | |
// Version : | |
// Copyright : GPL v2.0 | |
// Description : Hello World in C++, Ansi-style | |
//============================================================================ | |
#include <stdio.h> | |
#include <stdlib.h> |
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 | |
modprobe w1-gpio | |
modprobe w1-therm | |
if [ -d /sys/bus/w1/devices ]; then | |
id=$(ls /sys/bus/w1/devices/ | head -n 1); | |
temperature=$(tail -n 1 /sys/bus/w1/devices/$id/driver/$id/w1_slave | grep -o "[-0-9]*$") | |
echo "scale=3;" $temperature "/ 1000.0" | bc | |
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 | |
nohup VBoxHeadless -s centOS |