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
/* | |
* A simple libpng example program | |
* http://zarb.org/~gc/html/libpng.html | |
* | |
* Modified by Yoshimasa Niwa to make it much simpler | |
* and support all defined color_type. | |
* | |
* To build, use the next instruction on OS X. | |
* $ brew install libpng | |
* $ clang -lz -lpng libpng_test.c |
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
/* | |
an example of using GCC/Clang vector extension | |
clang argb_vector.c | |
./a.out | |
0 ffffffff ffffffff | |
1 dde0e2e5 dddfe1e4 | |
2 bbc0c5ca bbbfc4c9 | |
3 99a1a8af 99a0a7ae |
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 | |
# For all cpus, just report current states if no argument is passed | |
NCPU=$((`grep -c '^processor' /proc/cpuinfo`)) | |
if [ $# -lt 1 ]; | |
then | |
MAX=$((`cat /sys/devices/virtual/thermal/cooling_device0/max_state`)) | |
echo "Current cooling policy for $NCPU cpus: [0-$MAX]" | |
for (( i=0; i<$NCPU; i++ )) |
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
ps4sh> execuser ps4ftp.elf | |
log: [HOST][DEBUG]: [PS4SH] argc=1 argv=host0:ps4ftp.elf | |
log: [PS4][DEBUG]: [PS4LINK] commands listener received packet size (266) | |
log: [HOST][DEBUG]: [PS4SH] Opening ps4ftp.elf flags 0 | |
log: [HOST][DEBUG]: [PS4SH] Open return 7 | |
log: [PS4][DEBUG]: [PS4LINK] Received command execuserelf argc=1 argv=host0:ps4ftp.elf | |
log: [PS4][DEBUG]: [PS4LINK] file open req (host0:ps4ftp.elf, 0 0) | |
log: [PS4][DEBUG]: [PS4LINK] file open reply received (ret 7) | |
log: [HOST][DEBUG]: [PS4SH] 53024 result of lseek 0 offset 2 whence | |
log: [PS4][DEBUG]: [PS4LINK] file lseek req (fd: 7) |
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
[root@g5 ~]# nvram --partitions | |
# Sig Chk Len Name | |
0 5a 82 0002 nvram | |
1 5f 45 003e system | |
2 70 bd 00c1 common | |
3 a0 1e 0052 APL,MacOS75 | |
4 7f c6 00ad wwwwwwwwwwww | |
[root@g5 ~]# nvram --dump nvram | |
0x00000000 5a820002 6e767261 6d000000 00000000 |Z...nvram.......| |
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
[root@fedora-24 SEM_001-ok]# hexdump -C hd.bin | head -4 | |
00000000 c3 68 f3 d9 1c 6b 6f 05 20 9a 3f 94 ca 55 c0 e3 |.h...ko. .?..U..| | |
00000010 df 37 5d 80 63 0d 85 ad e4 ef 50 54 fe 2a f6 6b |.7].c.....PT.*.k| | |
00000020 8a 90 1b 80 10 e7 cd 7a c9 39 73 e3 6b ec a4 56 |.......z.9s.k..V| | |
00000030 93 3e c8 ab 86 17 a8 39 a9 ba bc 50 11 e1 1b f5 |.>.....9...P....| | |
[root@fedora-24 SEM_001-ok]# hexdump -C hd_3g.bin | head -4 | |
00000000 c3 68 f3 d9 1c 6b 6f 05 20 9a 3f 94 ca 55 c0 e3 |.h...ko. .?..U..| | |
00000010 df 37 5d 80 63 0d 85 ad e4 ef 50 54 fe 2a f6 6b |.7].c.....PT.*.k| | |
00000020 8a 90 1b 80 10 e7 cd 7a c9 39 73 e3 6b ec a4 56 |.......z.9s.k..V| | |
00000030 31 87 52 81 83 a8 70 d1 5f b8 54 36 1b ff 9e a0 |1.R...p._.T6....| |
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
/* gcc -o demo draw_png_2x.c | |
# ./demo 8 | |
0000 00 | |
0000 01 | |
1000 02 | |
0000 03 | |
00000000000000000000000000000000 00 | |
00000000000000000000000000000000 01 | |
00000000000000000000000000000000 02 |
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
/* | |
https://gist.githubusercontent.com/sudar/3404970/raw/3f085b750aaa2ff2f49b148827a19915a4857222/url-encode.c | |
gcc -o test urlenc.c -Wall | |
./test "[a b]" | |
%5ba%20b%5d | |
*/ | |
#include <stdio.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
toolchain info from https://github.com/rusxakep/asuswrt-security/raw/master/release/src/router/email-3.1.3/config.log | |
--------------- | |
PATH: /opt/trendchip/mips-linux-uclibc/usr/bin # (tbs-sdk missing piece) | |
PATH: /opt/brcm/hndtools-mipsel-uclibc/bin | |
PATH: /opt/brcm/hndtools-mipsel-linux/bin | |
PATH: /usr/local/sbin | |
PATH: /usr/local/bin | |
PATH: /usr/sbin | |
PATH: /usr/bin | |
PATH: /sbin |
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.scs.stanford.edu/histar/src/pkg/uclibc/test/stdlib/qsort.c | |
gcc -o qsort qsort.c -Wall | |
*/ | |
#include <stdio.h> | |
#include <dirent.h> | |
#include <stdlib.h> // /usr/include/stdlib.h:764:13: note: expected ‘__compar_fn_t’ but argument is of type ‘int (*)(const struct dirent **, const struct dirent **)’ | |
#include <unistd.h> |