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
--- gitweb.cgi 2018-05-30 00:26:43.000000000 +0300 | |
+++ my_gitweb.cgi 2018-06-16 15:26:41.207212864 +0300 | |
@@ -24,6 +24,23 @@ | |
binmode STDOUT, ':utf8'; | |
+ | |
+use CGI::Fast (-utf8); | |
+use FCGI (); | |
+use Encode (); |
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
1596: e5 b9 out 0x05, r30 ; 5 | |
1598: 70 81 ld r23, Z | |
159a: 70 93 f1 00 sts 0x00F1, r23 ; 0x8000f1 <__TEXT_REGION_LENGTH__+0x7e00f1> | |
159e: 91 50 subi r25, 0x01 ; 1 | |
15a0: 31 96 adiw r30, 0x01 ; 1 | |
15a2: 91 11 cpse r25, r1 | |
15a4: f8 cf rjmp .-16 ; 0x1596 <main+0x3d6> |
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
/* MIT/X Consortium License | |
© 2017 Urja Rannikko <urjaman at gmail dot com> | |
Permission is hereby granted, free of charge, to any person obtaining a | |
copy of this software and associated documentation files (the "Software"), | |
to deal in the Software without restriction, including without limitation | |
the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
and/or sell copies of the Software, and to permit persons to whom the | |
Software is furnished to do so, subject to the following conditions: |
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
SPI erase check acceleration | |
---------------------------- | |
SEND: [CMD] [1* len1] [1* len2] [3* len3] [1* compare_data] [len1 * send_data] | |
Send len1 bytes, then skip len2 bytes, | |
then read len3 bytes, check that each of them | |
matches data. | |
RECEIVE: [ACK] [3* offset] |
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
# us.map | |
keymaps 0-2,4-6,8-9,12 | |
alt_is_meta | |
strings as usual | |
keycode 1 = Escape | |
keycode 2 = one exclam | |
keycode 3 = two at at nul nul | |
keycode 4 = three numbersign | |
control keycode 4 = Escape |
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 | |
sleep 420 # TODO: Make configurable autohibernate timeout | |
while true; do | |
sleep 30 # Poll frequency | |
current_now="$(cat /sys/class/power_supply/bq27500-0/current_now)" | |
if [ $current_now -gt 0 ]; then | |
#echo "charging" | |
continue | |
fi | |
grep -q ' On' /sys/devices/platform/soc-audio/PCM1773/dapm_widget |
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
Goofy example we need to implement remotely (to be coded inside flashrom, sent to the programmer device): | |
uint8_t remote_function(uint24_t address, uint8_t data[], uint24_t len) { | |
uint24_t temp; | |
for (temp=0;temp<len;temp++) { | |
WRITE(ADDR1,B1); | |
WRITE(ADDR2,B2); | |
WRITE(ADDR3,B3); | |
WRITE(address+temp, data[temp]) | |
uint8_t t2 = READ(ADDR4) & 0x40; | |
uint24_t t3 = 0xFFFFFF; |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <ctype.h> | |
#include <string.h> | |
int main(int argc, char **argv) { | |
long int numbers[5] = { 0 }; | |
long int highest = 0; | |
if (argc < 2 || strlen(argv[1]) < 5) { | |
fprintf(stderr, "5 digits minimum input string must be given\n"); |