Using your Self-Hosted gitea server

How to Use Your Self-Hosted Gitea Server: A Beginner’s Guide for Developers

You have a self-hosted Git server running Gitea, and your team has invited you to collaborate on a project. Now what?

If you have never used Git before, the terminology can be intimidating: repositories, commits, branches, remotes, SSH keys, pushes, pulls…

Don’t worry. This guide will walk you through everything you need to get started, from configuring your computer to collaborating with other developers.

You don’t need administrator access to the Gitea server, and you don’t need to know how it was installed. You just need a Gitea account, access to a repository, and Git installed on your computer.

1. What You Need Before Getting Started

Ask your team leader or Gitea administrator for the following:

  • Gitea address: The URL of your team’s Git server, for example https://git.example.com.
  • Your account: Your Gitea username and login credentials.
  • Repository access: The repository you will be working on, and confirmation that you have permission to access it.
  • SSH clone address: The SSH address of the repository, normally displayed on its Gitea page.

You might also need the SSH port if your administrator has configured SSH to use something other than the standard port 22.

If you don’t have a Gitea account yet, ask your administrator to create one or invite you.

2. Create an SSH Key

SSH keys allow your computer to authenticate with Gitea without repeatedly asking for your account password.

The process involves two files:

Continue reading “Using your Self-Hosted gitea server”

Self-Hosted GitHub

Self-Hosted GitHub: Build Your Own Git Server with Gitea on Debian 13 (Trixie)

There is a persistent myth in the developer world that running your own Git server with a full web interface, pull requests, issue trackers, and multi-user SSH support is some massive enterprise undertaking. People imagine complex containers, heavy database clusters, and hours of fighting Linux permissions.

In reality, it takes about 30 minutes – and you can easily finish the whole thing with one hand while eating a sandwich. Maybe not on the first try (because there is some reading to do), but the moral of the story is that it isn’t rocket science.

The secret weapon is Gitea. Written in Go, Gitea is distributed as a single executable, runs happily on SQLite, and provides a surprisingly complete development platform without requiring a database server or an army of dependencies.

Even better, it handles multiple users seamlessly over SSH keys without giving those users shell access to your Linux server.

In this guide, we’ll turn a fresh Debian 13 (Trixie) installation into a self-hosted GitHub alternative using:

  • Gitea
  • Git
  • SQLite3
  • OpenSSH
  • Nginx
  • HTTPS

We’ll cover two installation methods: installing Gitea through a third-party APT repository or downloading the official binary directly.

An important design decision: Regardless of which installation method you choose, we’ll use one dedicated Linux account named gitea to run the application and handle Git-over-SSH connections. This keeps the rest of the configuration consistent.

Index

  1. Understanding Linux users and SSH authentication
  2. Installing the prerequisites
  3. Installing Gitea (two methods)
  4. Understanding Gitea’s directories and permissions
  5. Configuring systemd
  6. Configuring Nginx and HTTPS
  7. Completing the web setup wizard
  8. Generating SSH keys and pushing code
  9. Adding users and creating repositories
  10. Backups and maintenance
  11. Troubleshooting
Continue reading “Self-Hosted GitHub”

Running LLMs on a CPU

You probably know it is dog slow if you either run a large model, or a large context window !

Here are the technologies you should look into when running on CPU

The obvious are quantization and MOE, but since they are the obvious, i will skip those

1. Multi-Token Prediction (MTP): It effectively doubles or triples your token generation speed on a CPU without changing the model’s size

DeepSeek-V3 onwards

2. Llamafile: Llamafile introduced custom, dependency-free CPU kernels utilizing vectorized outer products tailored precisely to modern CPU instruction sets (like AVX-512 and Zen4/Skylake architectures)

This unlocked raw CPU speed gains ranging from 30% to over 500% purely for prompt processing and matrix execution on standard system RAM

It is best with AVX-512, but also gives a significant boost on older AVX2.

Ollama Automatically makes use of this

3.MLA: Multi-head Latent Attention (MLA) in V3/R1, which they have scaled further into Compressed Sparse Attention (CSA) in their latest architectures

MLA dramatically compresses the KV cache into a tiny latent vector.

DeepSeek V3 onwards

Colibri vs Soup

Installing root certificate in android and mitmproxy

Well, since you are here, you are probably planning to spy on traffic generated by the apps on your phone, probably looking to find out what apps are leaking your private information !

How this all works: When an application on your phone contacts a website/web-server over a secure connection, your phone checks the certificate, and checks whether or not that certificate was issued by an authority the phone trusts, what we are doing is telling the phone to add YOU to the list of trusted authorities, then, we create a proxy that the phone connects through (mitmproxy). Now, the proxy contacts the website on behalf of the application that sent the request, gets the response / contents of that page, saves a copy of that response, and repackages it using our own security certificate, then sends it to the phone, at this stage, the phone thinks the certificate belongs to the website it was contacting (Because now it trusts you), and everything works as it normally would. This does not work if the app has a pinned certificate, a pinned certificate is when an app does not trust the list of authorities the system maintains and requires a certain certificate, but this too has a workaround !

here is what you need to do.

I am assuming you already have a rooted virtual android device (AVD), if not, here are the instructions, in my case, even though it is mid 2026, i decided to go with a Google Pixel 6 with android 12 (The pixel six has updates up to the most current Android 17, but i decided to go with Android 12)

You need to create a root certificate, and install it in both mitmproxy and android, the mitmproxy gets the pem file with the certificate and private key (So that it can create certificates for websites on the fly), while android gets the one with the certificate (Obviously)

1- Gnerate the private key

openssl genrsa -out android-mitm-ca.key 4096

2 – Create the CA certificate


openssl req -x509 -new -sha256 -key android-mitm-ca.key -out android-mitm-ca.crt -days 3650 -subj "/C=JO/O=Android Traffic Analysis/CN=Android MITM Analysis CA" -addext "basicConstraints=critical,CA:TRUE" -addext "keyUsage=critical,keyCertSign,cRLSign"

3- Installing mitmproxy (On your debian machine)

install Prerequisites:

sudo apt install python3-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev libjpeg-dev zlib1g-dev

Debian 13 does not have it in repositories (12, and 14 do !), so we need to install from binaries downloaded from the website ! so i put them in /opt/mitmproxy and symlinked the files in /usr/local/bin

4- Concatinate/combine key and cert into 1 file for the mitmproxy

cat android-mitm-ca.key android-mitm-ca.crt > ~/.mitmproxy/mitmproxy-ca-my.pem
chmod 600 ~/.mitmproxy/mitmproxy-ca-my.pem

5- running and check that mitmproxy is using our cert

First, run mitmproxy.

NO-GO: mitmproxy –listen-host 192.168.7.119 –listen-port 8080 –certs “*=$HOME/.mitmproxy/mitmproxy-ca-my.pem” (No go because certs is for individual domains)

NO-GO:

mitmproxy --certs "*=$HOME/.mitmproxy/mitmproxy-ca-my.pem"

Or if needed

mitmproxy --listen-host 192.168.7.119 --listen-port 8080 --set confdir="$HOME/.mitmproxy-my"

Or if you want access from outside your network

mitmproxy --listen-host 192.168.7.129 --listen-port 8080 --set block_global=false --set confdir="$HOME/.mitmproxy-my"

From another terminal, let us try to get the contents of example.com through the proxy:

openssl s_client -proxy 192.168.7.119:8080 -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -issuer -subject

Now, if the proxy works as intended, and is correctly signing our requests with our own certificate, we should see something like isuer: Android MITM Analysis CA (The name we chose)

So, now our proxy is ready and serving, all that remains is relevant to Android, we have already made the android certificate to add (OUR_HASH.0)

Installing the certificate on the android phone

The only thing that is confusing about this section is that not all android phones work in the same way ! I am deliberately using Android 12 (Will install most software while being somewhat easier to tinker with), you on the other hand may be using android 16 or 17 (The latest at the time of writing).

Also, I am using a virtual android phone (With Android Studio), you may be using an actual rooter physical phone !

So, I will outline when something is going to be different on other android versions, and you will have to figure it out (Use Google, or gemini or something)

6- Certificate File Name for android

figure out the hash for the filename of the Android file (The file name should be “hash.0”, replace hash with the actual hash resulting from the below) this is how android expects the file name to be

HASH=$(openssl x509 -inform PEM -subject_hash_old -in android-mitm-ca.crt | head -1)
echo "$HASH"

Now, copy the file android-mitm-ca.crt and name the copy the same as the resulting hash with an added .0 at the end (THEHASH.0)

7- If android 16+ (I am using 12, but if you have 16+)

If your rootAVD image is Android 16 or above, don’t blindly follow the old /system/etc/security/cacerts/ procedure. Android 16 changed the system certificate location, and current mitmproxy documentation has a separate procedure involving a Magisk certificate-moving module.

check your android version

adb shell getprop ro.build.version.release
adb shell getprop ro.build.version.sdk
adb shell getprop ro.product.cpu.abi
adb shell su -c 'id'
$ adb shell getprop ro.build.version.release
12
$ adb shell getprop ro.build.version.sdk
31
$ adb shell getprop ro.product.cpu.abi
x86_64
$ adb shell su -c ‘id’
uid=0(root) gid=0(root) groups=0(root) context=u:r:magisk:s0

So, in my case, I am running android 12 ! Software development kit 31 (API level), X86 cpu, and (context=u:r:magisk:s0)

8- Explore the filesystem

Let us check and explore the files and folders on filesystem


> adb shell su -c 'ls -ld /system/etc/security/cacerts'
drwxr-xr-x 2 root root 4096 2023-07-26 23:02 /system/etc/security/cacerts

> adb shell su -c 'mount | grep -E " /system | / "'
/dev/block/dm-4 on / type ext4 (ro,seclabel,relatime)

> adb shell su -c 'ls -l /system/etc/security/cacerts | head'
total 952
-rw-r--r-- 1 root root 2871 2023-07-26 23:02 01419da9.0
-rw-r--r-- 1 root root 2914 2023-07-26 23:02 04f60c28.0
-rw-r--r-- 1 root root 2345 2023-07-26 23:02 0d69c7e1.0
-rw-r--r-- 1 root root 4622 2023-07-26 23:02 10531352.0
-rw-r--r-- 1 root root 4724 2023-07-26 23:02 111e6273.0
-rw-r--r-- 1 root root 4308 2023-07-26 23:02 12d55845.0
-rw-r--r-- 1 root root 2599 2023-07-26 23:02 1ae85e5e.0
-rw-r--r-- 1 root root 4931 2023-07-26 23:02 1df5a75f.0
-rw-r--r-- 1 root root 4535 2023-07-26 23:02 1e1eab7c.0

So, we do have the path /system/etc/security/cacerts on the phone, system (See second command above) is mounted read only, there are 952 certificate files in the /system/etc/security/cacerts folder.

Reminder: On Android 12, the traditional system CA location we’re interested in is: /system/etc/security/cacerts/ , The certificates are stored there using the OpenSSL subject-hash filename convention, e.g.: xxxxxxxx.0

The plan at this stage is to use magisk to add our certificate as an overlay, this way, we don’t need to modify the actual system, meaning, we will not be mounting system in read-write mode, read-only is fine by us

9- Explore Magisk

So let us start by checking what version of MAGISK is installed on the phone, and where it lives

> adb shell su -c 'magisk -v'
26.4:MAGISK:R
> adb shell su -c 'magisk --path'
/debug_ramdisk
> adb shell su -c 'ls -la /data/adb/modules'
total 24
drwxr-xr-x 3 root root 4096 2026-08-26 12:05 .
drwx------ 6 root root 4096 2026-08-26 12:11 ..
drwxr-xr-x 3 root root 4096 2026-08-26 12:07 hosts

Since this is rootAVD/Magisk, the clean approach is to use a Magisk overlay so we don’t modify the underlying system image.

10- Create the Magisk module with the certificate in it !

we can create our own small Magisk module specifically for the CA without touching the original system image. (the only existing module is hosts)

To create a magisk module we need to do the following

10.1- Create an identical folder structure on my debian machine *(Yours can be windows)

mkdir -p ~/.mitmproxy/module/system/etc/security/cacerts

Move your certificate (xxxxx.0) to the cacerts folder we created above

Now create the module file (Module dfinition file), obviously you can create it with a text editor as well if you wish.

cat > ~/.mitmproxy/module/module.prop <<'EOF'
id=android-mitm-ca
name=Android MITM Analysis CA
version=1.0
versionCode=1
author=Voodoo
description=Custom CA certificate for controlled Android traffic analysis
EOF

Now, put the contents of the module directory (Without the module directory itself) in a zip file

cd ~/.mitmproxy/module
zip -r ../android-mitm-ca.zip .

Now, open the zip file in fileroller (or 7-zip or winrar, whatever suits you) and make sure we have

module.prop
system/
system/etc/
system/etc/security/
system/etc/security/cacerts/
system/etc/security/cacerts/XXXXXXXX.0

If all looks good, super, we have the zip file for android…. go ahead and push it to the android virtual machine

> adb push ~/.mitmproxy/android-mitm-ca.zip /data/local/tmp/

Now, when the above works, install the zip file with magisk

> adb shell su -c 'magisk --install-module /data/local/tmp/android-mitm-ca.zip'
- Device is system-as-root
**************************
Android MITM Analysis CA
by Voodoo
**************************
*******************
Powered by Magisk
*******************
- Extracting module files
- Done

If you get an error above DO NOT REBOOT, only reboot if you get a message like the one i got. if not, Sorry man, you need to reverse the steps above ! something with the rootAVD restore command should do

Now, after rebooting (adb shell reboot), run this to see if our certificate appears !

adb shell su -c 'ls -l /system/etc/security/cacerts/'

Looks fine to me, but let us double check (replace the xxx with your actual file name)

adb shell su -c “ls -l /system/etc/security/cacerts/xxxxxx.0”
-rw-r–r– 1 root root 2000 2026-08-27 20:28 /system/etc/security/cacerts/xxxx.0

And if everything was done correctly, “adb shell su -c ‘mount | grep ” / “‘” should still show read-only

Now, let us play, I am very skeptical that this would work (Unless your android has openssl), but it can’t hurt to try… anyway, failiure here means nothing is the error is that “openssl: inaccessible or not found”, it is expected, and means nothing

adb shell su -c "openssl x509 -in /system/etc/security/cacerts/fea8a918.0 -noout -subject -issuer"

Pinned certificates

there are ways to get around this, ways from things as simple as using apk-mitm to remove the pinning, all the way to more serious stuff such as using jadx to modify the software before playing this game.

Here are some tools that can come in handy for this

  • FRIDA: Lets you inject snippets of JavaScript or your own library into native apps + simple tools built on top of the Frida API.
  • APK-MITM: (https://github.com/shroudedcode/apk-mitm): Remove certificate pinning from APK files
  • objection is a runtime mobile exploration toolkit powered by Frida, which supports certificate pinning bypasses on iOS and Android.
  • ssl-kill-switch2 blackbox tool to disable certificate pinning within iOS and macOS applications.
  • android-unpinner : From the same people who make the MITMPROXY, it modifies Android APKs to inject Frida and HTTP Toolkit’s unpinning scripts.

apk-mitm

node --version
npm --version
sudo apt install zip unzip
npm install -g apk-mitm

Now, to remove the pinning in your app

apk-mitm <path-to-apk>

Installing and rooting an AVD

Here, I would like to install an AVD with Android Studio, then root it

Where to install

First of all, I would like to have my virtual machines installed on a different SSD (Or Hard drive), in my case, this is because my main disk is always busy, and i want the Android Virtual Device to be snappy, others may have storage space concerns, others may want to skip this step, depends…

To do this on my Debian machine, i need to add the following line to ~/.bashrc

export ANDROID_AVD_HOME="/hds/ssngoem/avd"

On windows, i would have to Edit the system environment variables.

If you just want to move a machine, move it from ~/.android/avd/, don’t move the ini file, instead edit the ini file and fix the location of the virtual machine to wherever you put it

Make it

Now, all we need to do is create a machine in Android Studio!

Root it

To root the phone we need rootAVD

Start by checking whether the AVD is connected to the PC with adb devices

adb devices
List of devices attached
emulator-5554 device

So it seems that it is !

Now, we need rootAVD from newbit (https://gitlab.com/newbit/rootAVD)

git clone https://gitlab.com/newbit/rootAVD.git
cd rootAVD
./rootAVD.sh listAllAvds (On windows, use rootAVD.bat instead of sh)

The above command will give you a list of commands for each and every one of your Android Virtual Devices ! I will copy the first one, but the end of every line there is the last word that explains what it is

Once you run the command to root the phone, the phone will reboot (Or shutdown), you need to start the phone again (Make sure you chose cold boot from the … menu), and you will find a tool called magisk on the phone emulator, you need to run it, when you run it for the first time, it will tell you there is additional setup that needs to be done, which will reboot the device again

Your phone should now be rooted, to be sure, you can

adb shell
whoami
su (The phone screen will ask for permission)
whoami

HID Proxy Voodoo

A small device to help people build the things that don’t exist yet

There is a frustrating category of inventions that nobody builds.

Not because they are bad ideas.

Not because they are impossible.

Simply because the number of people who need them is too small.

If you are making a product for millions of people, development costs can be spread across a large market.

But what if the thing you want to build is for a few hundred people?

Or ten?

Or one?

This is especially true in accessibility.

A person may need a very specific input device because of a particular disability, a particular activity, or simply because the commercially available options do not fit their needs.

The problem is not always engineering.

Sometimes the problem is that every single one of these devices starts from zero.

Someone has to solve USB.

Someone has to write firmware.

Someone has to design electronics.

Someone has to build prototypes.

And all of that happens before anyone even knows whether the idea works.

I think this is backwards.


What if experimenting was cheap?

Imagine you have an idea for a completely new controller.

Not a normal keyboard.

Not a normal mouse.

Something that does not exist.

Maybe it is a wooden mechanism with a few switches.

Maybe it uses a potentiometer.

Maybe it is built from parts found in a workshop.

Maybe it looks ridiculous.

That is exactly how many good ideas start.

A piece of wood.

A few screws.

A sensor.

A crazy thought.

The problem is that turning that crazy thought into something a computer understands usually requires a lot of knowledge that has nothing to do with the actual invention.

You shouldn’t need to become a USB expert just to answer a simple question:

“Does this idea work?”


The idea behind the HID Proxy

The concept is simple:

Create a hardware platform that sits between the physical world and the computer.

A device that understands human input devices.

A device that can combine, translate, and create new inputs.

Instead of building a new USB device from scratch every time, use a flexible platform that already handles the difficult parts.

The first version is based around ESP32-S3 and STM32 microcontrollers and is designed around three main ideas:

1. Accept existing HID devices

Connect things like:

  • keyboards
  • mice
  • game controllers
  • joysticks
  • steering wheels
  • pedals
  • switches

and use them as building blocks.

2. Create new HID devices

Take simple electronics:

  • buttons
  • potentiometers
  • sensors
  • custom mechanisms

and turn them into devices the computer already understands.

A homemade controller should not require a homemade USB stack.

3. Manipulate and combine inputs

Sometimes the interesting device is not a single input.

Maybe a joystick and some buttons need to become a completely different controller.

Maybe two devices need to work together.

Maybe a non-standard interface needs to control a standard computer.

The hardware should be the easy part.


Why accessibility?

This project started as a general-purpose idea, but accessibility is where I think it has the strongest purpose.

The smaller the target group, the harder it becomes to justify development costs.

A company can spend thousands designing a product for millions of users.

But who funds a device needed by twenty people?

Or a device needed by a small group with a rare condition?

Those ideas often disappear, not because they are bad, but because the economics make them impossible.

If the cost of experimentation becomes low enough, more of those ideas can exist.

That is the goal.

Not to replace professional medical equipment.

Not to pretend one board can solve every accessibility challenge.

Simply to make it easier for people with good ideas to test them.


But isn’t this just a maker board?

Yes.

And no.

An engineer or hobbyist should absolutely be able to keep one of these in their toolbox.

The same way someone keeps an Arduino, a multimeter, or a breadboard nearby.

Not every experiment becomes a product.

Most don’t.

That is fine.

The purpose of experimentation is not that every idea succeeds.

The purpose is making failure cheap enough that people are willing to try.


The software side

There are many possible ways to use the platform.

A beginner might connect a few components and use a simple scripting language such as Lua.

Copy a small example.

Change a few numbers.

Test an idea.

A more experienced developer might replace parts of the firmware completely.

Someone else might only use the hardware design as a foundation for their own project.

I don’t think there should be one “correct” way.

The platform should disappear into the background and let people focus on the thing they are actually trying to build.


Why am I building this?

This is the part where I am supposed to write something inspirational.

I could say that I have always dreamed of changing lives.

That would not be completely false.

I do want this project to have a positive impact.

But the real answer is more complicated.

I like making things.

I like the moment when an idea stops being an idea and starts moving.

A machine doing something because I imagined it and built it is still one of the most satisfying feelings I know.

Somewhere along the way, that feeling became weaker.

While thinking about why, I came across research around the overjustification effect—the idea that external rewards can sometimes replace the internal motivation that made you enjoy something in the first place.

I do not think that explains everything.

But I think it explains part of it.

This project started because I was working on something else, only to discover that the thing I was building already existed.

Normally that means the project goes into a drawer.

Instead, I looked at all the work already done:

The research.

The designs.

The ideas.

The piles of pseudocode.

And I asked:

“What if this effort becomes a tool that helps other people build things?”

Maybe that is a better destination.


Quality matters

One thing I want to make very clear:

This is not meant to be a “quick hack that works sometimes.”

For accessibility especially, reliability matters.

A clever prototype is interesting.

A device someone depends on is something else entirely.

I do not want to cut corners simply because something works in a demonstration.

The objective is not just flexibility.

It is flexibility built on a reliable foundation.


Where does this go?

Honestly?

I don’t know yet.

Some parts will likely become open source.

Some parts may take more time, especially anything involving networking and security.

A device that controls a wheelchair, communication system, or another important tool deserves careful consideration.

“Open” and “secure” are both important goals, and sometimes they require difficult decisions.

The hardware will evolve.

The software will evolve.

The community around it—if one forms—will probably influence it in ways I cannot predict.


How can you help?

At this stage, the biggest challenge is simple:

Building hardware costs money.

Prototype boards.

Components.

Manufacturing.

Testing.

The boring things that are absolutely necessary before the interesting things can happen.

If you believe this idea is worth exploring, support can take many forms:

  • Sponsorship.
  • Technical feedback.
  • Testing.
  • Sharing the project with someone who may benefit.

The goal is not to build one product.

The goal is to make it easier for people to build the products that do not exist yet.


Final thoughts

I don’t know if this will become a commercial product.

I don’t know if it will become a widely used platform.

But I do know this:

There are people with ideas that never become reality because the first step is too expensive.

If this project can remove some of that first barrier, then it will have been worth building.

And honestly…

“If this platform saves someone from spending three weeks writing USB firmware just to test an idea, then it has already justified its existence.”

TTGO T9 Audio – Everything

I have had those boards (V1.6) for over a decade, had fun plans for them, but never got around to doing anything with them !

This document will always be a work in progress, even after i finish whatever project I will be making, anything new that I find about this board or similar boards will end up here

The TTGO T9 Audio RGB_LED WM8978 is an

  • ESP32 : ESP32-WROVER 802.11 b/g/n + Bluetooth 4.1 LE module with 4MB Flash, 4MB PSRAM
  • audio chip (WM8978 stereo CODEC)
  • SD card slot and 18 RGB LEDs.
  • Gyroscope++: InvenSense MPU-9250 : 9-axis motion-tracking sensor IMU 9-DOF MPU-9250 9-Axis Attitude + Gyroscope + Accelerator + Magnetometer Sensor Module
  • Battery: The circuitry to charge and use a battery in UPS mode !
  • built-in microphone
  • 3.5mm audio jack

Now that I might have some free time soon, I decided to compile the resources here for my reference, and to see what fun project they might be good for !

1- Links

Unorganized links

new boards, AI Thinker … ESP32-A1S

New boards, LyraT

RAM disk on boot

I will come back and provide some context about why i need this later, for now, if you want your PC to take away some ram and make a RAM disk, you have two ways, I would go with the first

The easy way (tmpfs)

Start by creating a directory to mount the ram disk onto

sudo mkdir -p /hds/ram

Then just add a line like the following to the /etc/fstab file

tmpfs /hds/ram tmpfs defaults,size=80G 0 0
Or, the more elaborate
tmpfs /hds/ram tmpfs rw,noatime,nosuid,nodev,noexec,size=80G,mode=0755 0 0

Now mount it
sudo mount -a (To avoid having to restart)

If you have a dual CPU setup, I recommend you check out NUMA tuning before playing with this

The other way (ramfs)

You will not see real world gains in speed, they are super marginal, and you lose a lot of features like swapping ! Also, it eats up all the ram in advance, ram that could have been used for caching
If you must, it is the same as above, but the line in fstab is the following instead

ramfs /hds/ram ramfs rw,noatime,nodev,nosuid,noexec 0 0

Notes:

1- “df -h” will report an 80 GB disk, even though they are not missing from ram, it is an upper limit, not a pre-alocated space

2- noatime doesn’t matter much, on a ram disk, it is a neglegible load, I add it anyways because none of my applications can make use of ti

3- noswap : swapping a ram disk is probably the worst idea ever ! so you may want to consider

tmpfs /hds/ram tmpfs rw,noatime,nosuid,nodev,noexec,noswap,size=80G,mode=0755 0 0

4- NUMA tuning

Now, to keep all the ram on one CPU, while still allowing it to spill over to the ram from th other CPU when needed, you can pin the process to a CPU and make the ram of that CPU preferred !

Here is an example, if you intend to use the disk with MySQL, you would do as follows

1- Make sure the daemon is called mysql

systemctl status mysqld

2- Create an override file
sudo systemctl edit mysql

3- Add NUMA binding (Empt line means “Clear the existing startup command first”)
[Service]
ExecStart=
ExecStart=/usr/bin/numactl –cpunodebind=1 –preferred=1 /usr/sbin/mysqld

sudo systemctl daemon-reload

sudo systemctl restart mysql

ps aux | grep mysqld

An alternative to all the above would be to pin it to CPUs !

[Service]
CPUAffinity=16-31

The rest is just like the other method

Detecting Light and movement with Arduino

When it comes to detecting light and movement with microcontrollers, one has quite a bit of options, after explaining each one, I will compare them for you at the bottom of this pots

LDR Light Dependent Resistor

This is the simplest one, and it only costs a few cents

Phototransistor

A photo transistor is in my oppinion a great tool to use with microcontrollers, very fast response time (Slightly slower than a photodiode), and can be used with the digital pins, the reason is that it works exactly like a transistor, but instead of enabling the current by providing voltage to the base, the current is provided from light !

So, if you were to connect the Emitter to ground, and the Collector to the digital pin, they would get connected when light is detected, that is it

Photo interrupter

A photo interrupter detects the presence, absence, or movement of an object by sensing when a light beam between an emitter and a receiver is blocked.

This is basically something you would find in your inkjet printer ! or in a factory (Conveyor belt), or most commonly, on en elevator (Door opens when an object is in the way)

The transmitter and receiver work together either side by side or opposing each other, when they are side to side, a mirror reflects the light onto the receiver

If you are trying to detect a red light or a light of the wavelength close to that of the interrupter, odds are that you can use the receiver on its own without the LED (Transmitter), simply do not power it up !

photodiode

PIR (Movement) sensors

PIR Sensors such as the HC-SR501 can detect movement, but they requier more than 1 component, the sensor itself, the plastic cover for the sensor (Pir Lens Cover creates a FRESNEL LENS), and an IC that amplifies the signal and analyzes it !

Project cloud electric meter

The cloud electric meter is a project consisting of a 3 parts

1- A microcontroller and a current transformer (As of now, I am using the SCT-013)
2- A server to collect the data from the microcontrollers
3- A mobile phone app to display the data

The second and third (Server and application) are beyond the scope of what we are doing here, here, I will be examining all the options for a microcontroller and current transformer, With and without the cloud part.

1- The no cloud setup

The first example we will be using is the current transformer (SCT-013) with a nodeMCU ESP8266 that shows data about the current on a screen, this is the simplest setup, and is for people who are here to figure out how to connect their transformer, To do this, you will need a 16 x 2 screen, and an LCD I2C Interface Adapter.

1- Connecting the LCD to an ESP8266 (Tutorials for arduino and ESP32 are all over the internet)
2- Connecting the Current Transformer
3- The software