I put IPFS on a Raspberry Pi and so should you!
- Raspberry Pi 3 B: $43
- Micro SD card: $11
- [Raspberry Pi charger](ht
# based on 2023-05-03-raspios-bullseye-arm64-lite.img.xz | |
# | |
su [your password] | |
apt-get update && sudo apt-get upgrade | |
curl -fsSL test.docker.com -o get-docker.sh && sh get-docker.sh | |
usermod -aG docker [user_name] | |
# fix 'memory/swap' error | |
echo "cgroup_enable=memory swapaccount=1 cgroup_memory=1 cgroup_enable=cpuset" >> /boot/cmdline.txt |
--! lua.org | |
--! get a argument from cli in lua-5.1 | |
if not arg or #arg == 0 then | |
print('lua args.lua [nome]'); | |
os.exit(1); | |
end | |
print( _VERSION ) | |
print( string.format('ola %q', arg[1]) ) |
-- | |
-- based on https://www.php.net/manual/en/function.str-split.php | |
-- feel to free to validate/adjust to uses asserto/error | |
-- | |
-- Denis Dos Santos Silva | |
-- | |
local function str_split(str, length) | |
local result = {} | |
local index = 1 |
/* | |
php -v | |
PHP 8.0.28 (cli) (built: Feb 14 2023 18:33:29) ( NTS ) | |
Copyright (c) The PHP Group | |
Zend Engine v4.0.28, Copyright (c) Zend Technologies | |
with Zend OPcache v8.0.28, Copyright (c), by Zend Technologies | |
grep CI_VERSION system/core/CodeIgniter.php | |
define('CI_VERSION', '3.0.0'); | |
*/ |
-- insert or replace sqlite 3.x | |
create table config( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, key text, value text ); | |
insert into config values (1, "fg", "#ff00ff" ); | |
insert or replace into config(id, key, value) values ((select id from config where key = "bg"), "bg", "0x00ff00"); | |
SELECT * FROM config; | |
$ sqlite3 < test.sql | |
SQLite version 3.34.0 2020-12-01 16:14:00 | |
1|fg|#ff00ff |
#!/bin/sh | |
# | |
# download package from http://syslog4j.org/ | |
# check also https://manpages.ubuntu.com/manpages/xenial/man1/logger.1.html | |
# | |
java -cp syslog4j-0.9.46-bin.jar \ | |
org.productivity.java.syslog4j.server.SyslogServerMain \ | |
-h 127.0.0.1 \ | |
-p 9999 \ |
#!/bin/sh | |
set -e | |
# TODO: | |
# - check arguments | |
# - check file | |
ffmpeg -i $1 -s hd480 -c:v libx264 -crf 23 -c:a aac -strict -2 `basename $1 .mp4`_480p.mp4 |
#!/bin/sh | |
set -e | |
su gitea | |
cd /home/git/gitea | |
./gitea --version | |
./gitea admin change-password --username your-login --password your-new-super-password | |
exit 0 |
@echo off | |
echo "be careful this can explode your disk" | |
echo "hit enter to continue" | |
pause | |
d: | |
cd d:\docs | |
takeown /r /f * | |
ICACLS * /T /Q /C /RESET | |
pause |