I'm running some script every day on my raspberry and after some fairly long time it could execute with efficiency.
When checking Munin data I could see an obvious raise on commited memory but I never looked for the guilty application. I was restarted the raspberry evry 3-4 months to purge commited memory.
But recently I found out how to purge the commited memory and avoided restarting the raspberry (as you can see above commited dropped without restarting during march 2026). Source: Server crashing because of out of memory
It is written:
In this case there are large commits that are not actively used by apps. You can see that the committed memory is much larger then the active memory.
To quickly find likely culprits, use:
ps aux --sort -vsz | head
Indeed I could find that the guilty application raising slowly the commited memory was Airsonic. Restarted it purged the commited memory. I will restart airsonic (bi-)weekly from now on.
=> see above end of 6th day of 13th week.
When my script bugged and did not close all chromium instances I could also identify and kill them.
=> see above April 2nd and end of April 5th
OpenWRT product page: FriendlyARM NanoPi R5C
From above link I downloaded this file: openwrt-rockchip-armv8-friendlyarm_nanopi-r5c-ext4-sysupgrade.img.gz
Go to System > eMMC Tools
Upload the file and wait till it's finished.
Power off, power on.
BusyBox v1.37.0 (2026-01-02 17:07:02 UTC) built-in shell (ash)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
OpenWrt SNAPSHOT, r33744-eba6fa859e
-----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
OpenWrt 25.12.2, r32802-f505120278 Dave's Guitar
-----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
OpenWrt recently switched to the "apk" package manager!
OPKG Command APK Equivalent Description
------------------------------------------------------------------
opkg install apk add Install a package
opkg remove apk del Remove a package
opkg upgrade apk upgrade Upgrade all packages
opkg files apk info -L List package contents
opkg list-installed apk info List installed packages
opkg update apk update Update package lists
opkg search apk search Search for packages
------------------------------------------------------------------
For more information visit:
https://openwrt.org/docs/guide-user/additional-software/opkg-to-apk-cheatsheet
root@OpenWrt:~#
Using Luci interface I finally could connect R5C to my ISP wifi router using wifi.
At the end I installed OpenWRT 24.10.2. It did not improve Wifi issue at startup but I kept it (see below patch).
⚫ Configuring OpenWRT
⚪ Disabling IPv6 on LAN
Network > Interfaces > Edit lan interface > DHCP Server > IPv6 Settings
Disable RA-Service, DHCPv6-Service, NDP-Proxy, and make sure Designated Master is unchecked.
⚪ Enable wifi interfaces one by one to avoid looping bug
When configuring wifi interfaces one after the other, all works well. Then at next reboot, all interfaces want to restart at same moment and obviously RTL8822CE driver bugs.
I had to put this to get wifi working after a reboot
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
sleep 45
logger "Realtek fix: Force reset for wlan and phy0-ap0"
#worked with 25.12.2 version of openwrt but not with 24.10.2
#ip link set wlan down
#ip link set phy0-sta0 down
#sleep 5
#ip link set wlan up
#ip link set phy0-sta0 up
The issue is the following. When watching streaming videos, if I use another device to surf the internet (twitter, instagram, ...), the stream freezes for a while and/or degrade quality.
To try to solve thie issue, I installed SQM following that OpenWRT website page.
opkg update
opkg install luci-app-sqm
To maximize performance most modern devices will benefit from enabling under LuCI > Network > Interfaces > Global network options > Packet Steering (all CPUs).
Doing a speed test, i'm getting about DOWNLOAD 80+ Mbit/s UPLOAD 80+ Mbit/s (R5C WWAN is CLIENT Wifi ac, channel 149, width 80 MHz, country code US).
So I setup the SQM like this:
Network > SQM QoS > Basic settings
Interface name => chose the wifi client interface
Download speed (ingress) => 60000
Upload speed (egress) => 50000
Network > SQM QoS > Queue discipline
Queueing discipline => fq_codel
Network > SQM QoS > Link Layer Adaptation
Link layer => Ethernet with overhead: select for e.g. VDSL2.
Per Packet Overhead (bytes) => 34
⚪ Logging and checking temperatures, and much more
The case of the R5C feels hot when touching it. Checking temperatures one shot in commamd line:
# awk '{printf "%5.1f C \n", $1/1000}' /sys/class/thermal/thermal_zone*/temp
48.9 C
47.8 C
#
After installing the packages and rebooting rooter, a new menu appears in Statistics > Setup.
⚪ Logging Network usage
Ultimatly my router will be getting internet from 4G usb device. I wanna know how much internet I consume currently to understand later what monthly plan I should chose.
Reading that reddit thread I then follow this webpage.
# opkg update
# opkg install luci-app-vnstat2
Check your WAN connection you wana monitor (chose correct alias in bold):
# . /lib/functions/network.sh; network_get_device if_wan wwan; echo "Your WAN Interface is: $if_wan"
Your WAN Interface is: phy0-sta0
#
You need to determine the max bandwidth of your connection in Mbit. IA told me
Pour trouver la vitesse maximale (capacité théorique) de votre carte Wi-Fi AC afin de configurer vnStat, vous devez identifier son Link Speed (vitesse de liaison). Contrairement à l'Ethernet, cette vitesse varie selon la distance et les obstacles, mais vous pouvez trouver le maximum que votre matériel supporte actuellement.
Pourquoi c'est important pour vnStat ? Le Wi-Fi AC (802.11ac) peut théoriquement atteindre 1300 Mbps ou plus, mais en pratique, votre lien peut être à 433 ou 867 Mbps. Si vous réglez MaxBandwidth trop bas dans vnstat.conf, vnStat ignorera le trafic dépassant cette limite. Conseil : Pour une carte Wi-Fi AC, réglez MaxBandwidth à 1300 ou 2000 pour être sûr de ne rien rater, même si votre connexion internet est plus lente.
So 1000 will be fine since I limited the link using SQM at about 60 Mbit.
# nano /etc/vnstat.conf
I set it like this:
# default interface (leave empty for automatic selection)
;Interface "phy0-sta0"
# maximum bandwidth (Mbit) for all interfaces, 0 = disable feature
# (unless interface specific limit is given)
;MaxBandwidth 1000
# how often (in seconds) interface data is updated
;UpdateInterval 300
Then:
# nano /etc/config/vnstat
config vnstat
list interface phy0-sta0
Creating the database:
# vnstat --add -i phy0-sta0
Adding interface "phy0-sta0" to database for monitoring.
vnStat daemon will automatically start monitoring "phy0-sta0" within 5 minutes if the daemon process is currently running.
#
Ran these commands to enable the daemon + auto start the daemon if you reboot your device:
Then restarted the R5C and got a new luci menu: Status > Traffic Monitor
To make it persistent I used method 2. Just I had to mofify this:
Removed: "$(vnstat_option DatabaseDir)"
Replaced by: "/var/lib/vnstat"
It will backup on proper hot reboot (from luci interface by example) and every 12 hours (midnight and midday to prevent more or less decent data loss in case of sudden power loss). Crontab line:
0 */12 * * * /etc/init.d/vnstat_backup backup
⚪ Wireguard to be able to administrate router from outside
In Peers make sure Allowed IPs are local netwoek and wireguard network + ends by /24.
Add a Persistent Keep Alive to keep the router accessible any time (I did not because I am using ping in Statistics (luci-app-statistics).
⚪ Expanding disk space
BE CAREFUL: doing the following I lost vnstat2 data backup and script to backup data every 12h and at hot reboot of device.
There is an eMMC 64GB, but the available space after OpenWRT installation is of 98.33MiB. Fills tight as 35MiB are already used. Would like to expand it just in case.
To avoid data loss, go to System > Backup/Flash firmware. Then in configuration tab add the extra files you need to save. In my case:
## This file contains files and directories that should
## be preserved during an upgrade.
# /etc/example.conf
# /etc/openvpn/
# added by pmd
/etc/init.d/vnstat_backup
/etc/vnstat_backup.tar.gz
Then I made a backup. System > Backup/Flash firmware. Click Generate archive.
# owut upgrade
But it finishes with an error:
ERROR: Build failed with status 500 (--version-to 24.10.6 --device rockchip/armv8:friendlyarm_nanopi-r5c:ext4)
The above errors are often due to the upgrade server lagging behind the
build server, first suggestion is to wait a while and try again
The above not working I have specified same version destination:
# owut upgrade --version-to 24.10.2
ASU-Server https://sysupgrade.openwrt.org
Upstream https://downloads.openwrt.org
Target rockchip/armv8
Profile friendlyarm_nanopi-r5c
Package-arch aarch64_generic
Version-from 24.10.2 r28739-d9340319c6 (kernel 6.6.93)
Version-to 24.10.2 r28739-d9340319c6 (kernel 6.6.93)
48 packages are out-of-date
There are 0 missing and 1 modified default packages
Request hash:
05fbeb33d6a335cb7ab52baef274682b0722f6df465435b34f514940a50c5a2d
--
Status: queued - 0 ahead of you
Progress: 0s total = 0s in queue + 0s in build
--
Status: container_setup
Progress: 12s total = 0s in queue + 12s in build
--
Status: validate_manifest
Progress: 29s total = 0s in queue + 29s in build
--
Status: building_image
Progress: 77s total = 0s in queue + 77s in build
--
Status: done
Progress: 81s total = 0s in queue + 81s in build
Build succeeded in 81s total = 0s in queue + 81s to build:
Image saved : /tmp/firmware.bin
Installing /tmp/firmware.bin and rebooting...
#
After reboot:
# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 990.7M 34.8M 939.9M 4% /
tmpfs 1.9G 1.8M 1.9G 0% /tmp
tmpfs 512.0K 0 512.0K 0% /dev
⚪ Installing and configuration of e3372h stick to get LTE WAN
Go to Network > Interfaces and create Add new interface... with following parameters:
General settings:
| Protocol => NCM
| Bring up on boot => YES
| Modem device => /dev/cdc-wdm0
| Network Mode => LTE
| IP Protocol => IPv4
| APN => mmsbouygtel.com
| PAP/CHAP username => keep empty if not necessary
| PAP/CHAP password => keep empty if not necessary
Firewall setting:
| Assign firewall-zone as => wan
Advanced setting:
| Use default gateway=> YES (put NO if you are testing and don't want all network output through this interface
Save and apply and after this router should be connected to internet (check modem led not blinking anymore).
⚪ Avoir some logging
Sun Apr 19 14:11:22 2026 daemon.warn dnsmasq[1]: possible DNS-rebind attack detected: dns.msftncsi.com
Sun Apr 19 14:11:22 2026 daemon.warn dnsmasq[64]: possible DNS-rebind attack detected: dns.msftncsi.com
Sun Apr 19 14:12:32 2026 daemon.warn dnsmasq[1]: possible DNS-rebind attack detected: dns.msftncsi.com
Sun Apr 19 14:13:44 2026 daemon.warn dnsmasq[1]: possible DNS-rebind attack detected: dns.msftncsi.com
Sun Apr 19 14:13:44 2026 daemon.warn dnsmasq[1]: possible DNS-rebind attack detected: dns.msftncsi.com
Sun Apr 19 14:13:44 2026 daemon.warn dnsmasq[65]: possible DNS-rebind attack detected: dns.msftncsi.com
Sun Apr 19 14:15:10 2026 daemon.warn dnsmasq[1]: possible DNS-rebind attack detected: dns.msftncsi.com
Sun Apr 19 14:15:13 2026 daemon.warn dnsmasq[1]: possible DNS-rebind attack detected: dns.msftncsi.com
Sun Apr 19 14:15:14 2026 daemon.warn dnsmasq[1]: possible DNS-rebind attack detected: dns.msftncsi.com
Voici une macro VBA qui va modifier tous les graphiques de la feuille active uniquement, en appliquant une couleur spécifique à chaque série (courbe) dans chaque graphique de la feuille active.
Code VBA à utiliser :
Appuie sur Alt + F11 pour ouvrir l’éditeur VBA.
Clique sur Insertion > Module.
Colle ce code :
Sub ColorerCourbesGraphiques()
Dim ch As ChartObject
Dim s As Series
For Each ch In ActiveSheet.ChartObjects
With ch.Chart
If .SeriesCollection.Count >= 1 Then
.SeriesCollection(1).Format.Line.ForeColor.RGB = RGB(128, 128, 128) ' Gris
End If
If .SeriesCollection.Count >= 2 Then
.SeriesCollection(2).Format.Line.ForeColor.RGB = RGB(0, 112, 192) ' Bleu
End If
If .SeriesCollection.Count >= 3 Then
.SeriesCollection(3).Format.Line.ForeColor.RGB = RGB(255, 0, 0) ' Rouge
End If
End With
Next ch
MsgBox "Couleurs mises à jour pour tous les graphiques de la feuille active."
End Sub
Important :
Cette macro ne modifie que les graphiques de la feuille active.
Si tu veux l’appliquer à une autre feuille, sélectionne-la avant d’exécuter la macro.
BusyBox v1.35.0 (2023-04-27 20:28:15 UTC) built-in shell (ash)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
OpenWrt 22.03.5, r20134-5f15225c1e
-----------------------------------------------------
root@OpenWrt:~#
Router will be using brcmsmac wifi driver so you can use wifi N (WNR3500L v1 woking perfectly but wifi in Wireless-G only).
For information there is another propriatory driver available which might have better performances but I didn't get it working (broadcom-wl). It takes too much space (I used this script to free the space when opkg couln't install fully)
port is : /dev/ttyUSB1
flowcontrol : none
baudrate is : 115200
parity is : none
databits are : 8
stopbits are : 1
escape is : C-a
local echo is : no
noinit is : no
noreset is : no
hangup is : no
nolock is : no
send_cmd is : sz -vv
receive_cmd is : rz -vv -E
imap is :
omap is :
emap is : crcrlf,delbs,
logfile is : none
initstring : none
exit_after is : not set
exit is : no
!! Settings mismatch !! Type [C-a] [C-v] to see actual port settings
Type [C-a] [C-h] to see available commands
Terminal ready
AT
OK
AT+CSQ
+CSQ: 11,99
OK
ERROR
AT^SETPORT?
^SETPORT:FF;10,12,16,A1,A2
OK
<<<<<<<<<<<<<<<<<< here I did CTRL+A then CTRL+X
Terminating...
Thanks for using picocom
root@OpenWrt:~#
# Enter the FQDNs you want to check with ping (space separated)
# Script does nothing if any tries to any FQDN succeeds
FQDN="www.google.com"
FQDN="$FQDN www.amd.com"
FQDN="$FQDN www.juniper.net"
# Sleep between ping checks of a FQDN (seconds between pings)
SLEEP=3 # Sleep time between each retry
RETRY=3 # Retry each FQDN $RETRY times
SLEEP_MAIN=60 # Main loop sleep time
SLEEP_RESTSTART_NETWORK=240 # Waiting time before retrying after an interface reset
check_connection()
{
for NAME in $FQDN; do
for i in $(seq 1 $RETRY); do
ping -c 1 $NAME > /dev/null 2>&1
if [ $? -eq 0 ]; then
#echo "ping $NAME OK"
#echo "ping $NAME OK" | logger -t "connectivityCheck.sh[$$]" -p info
return 0
fi
#echo "ping $NAME NOK"
echo "ping $NAME NOK" | logger -t "connectivityCheck.sh[$$]" -p info
sleep $SLEEP
done
done
# If we are here, it means all failed
return 1
}
echo "Starting connectivityCheck.sh" | logger -t "connectivityCheck.sh[$$]" -p info
while true; do
check_connection
if [ $? -ne 0 ]; then
echo "All ping for connectivity check failed... Trying reconnecting..." | logger -t "connectivityCheck.sh[$$]" -p info
/etc/init.d/ncm-network start
sleep $SLEEP_RESTSTART_NETWORK
else
sleep $SLEEP_MAIN
fi
done
As you see, above script will be calling /etc/init.d/ncm-network if connectivity is lost.
Let's create it:
# Interface to send AT commands
DEVICE='/dev/ttyUSB1'
# Interface name from /etc/config/network
IFNAME='wwan4g'
# Your APN:
APN=$(uci get network.wwan4g.apn)
START=70
STOP=90
start() {
if [ -e ${DEVICE} ]; then
#/etc/init.d/smstools3 stop
ifdown $IFNAME
sleep 3
echo -n "1-1" > /sys/bus/usb/drivers/usb/unbind
sleep 3 # waiting for USB disconnection
echo -n "1-1" > /sys/bus/usb/drivers/usb/bind
sleep 10 # waiting for USB connection
echo -ne "AT^NDISDUP=1,0\r\n" > ${DEVICE}
echo "AT^NDISDUP=1,0 > ${DEVICE}" | logger -t "ncm-network[$$]" -p info
sleep 3 # wait for disconnect
echo -ne "AT+CGATT=0\r\n" > ${DEVICE}
echo "AT+CGATT=0 > ${DEVICE}" | logger -t "ncm-network[$$]" -p info
sleep 3 # wait for detach from network
echo -ne "AT+CFUN=0\r\n" > ${DEVICE}
echo "AT+CFUN=0 > ${DEVICE}" | logger -t "ncm-network[$$]" -p info
sleep 10 # wait for activate plane mode
echo -ne "AT+CFUN=1\r\n" > ${DEVICE}
echo "AT+CFUN=1 > ${DEVICE}" | logger -t "ncm-network[$$]" -p info
sleep 10 # wait for deactivate plane mode (activate radio)
#echo -ne "AT^NDISDUP=1,1,\"${APN}\"\r\n" > ${DEVICE}
#echo "AT^NDISDUP=1,1,\"${APN}\" > ${DEVICE}" | logger -t "ncm-network[$$]" -p info
#sleep 3 # wait for connect
ifup $IFNAME
echo "/etc/init.d/ncm-network start ${DEVICE} executed" | logger -t "ncm-network[$$]" -p info
#sleep 45
#/etc/init.d/smstools3 start
else
echo "No such device ${DEVICE}" | logger -t "ncm-network[$$]" -p info
fi
}
stop() {
if [ -e ${DEVICE} ]; then
#/etc/init.d/smstools3 stop
ifdown $IFNAME
sleep 3
echo -ne "AT^NDISDUP=1,0\r\n" > ${DEVICE}
echo "AT^NDISDUP=1,0 > ${DEVICE}" | logger -t "ncm-network[$$]" -p info
echo "/etc/init.d/ncm-network stop ${DEVICE} executed" | logger -t "ncm-network[$$]" -p info
else
echo "No such device ${DEVICE}" | logger -t "ncm-network[$$]" -p info
fi
}
Above script will be restarting the network if connectivity loss is confirmed by /root/connectivityCheck.sh.
To have /root/connectivityCheck.sh monitoring connectivity status, you need to start it at rooter startup. In luci interface, go to System > Startup > Local startup and add this lines before exit 0:
sleep 180 # waiting for router to be started for sure
/root/connectivityCheck.sh &
exit 0
⚫ Identify Wi-Fi connection as metered automatically
Le montant de la porte, du côté charnière, était chancelant. La porte ne fermait plus. Manifestement l'artisant n'a pas mis beaucoup de mousse...
Achat/utilisation de quelques outils et consommables:
Visseuse perceuse Bosh ☑️
Meche bois 8☑️
Perceuse à percussion☑️
Longue meche beton 8☑️
Longues vis + chevilles☑️
Fraise conique pour pourvoir cacher la vis☑️
Mousse pour porte? ❌ car les vis ont été préférées.
Colle a bois☑️
Platre ☑️
Peinture blanche ☑️
Pinceau ☑️
Renforcement avec une grosse vis de 8x120mm au niveau de chaque charnière. Ensuite comblage au platre, ponçage, peinture. Collage des caches côté chambre.
Armoire de la chambre :
La porte de gauche ne ferme plus. Les charnières des portes de gauche et centrale sont tordues.
Achat/utilisation de quelques outils et consommables:
Visseuse perceuse Bosh ☑️
Meche bois 5 ☑️
6x charnières extra grande ouverture ☑️
Réalisation d'un maquette pour créer un chablon (pas de photo) afin de savoir ou percer.
Radiateur :
Bizarre le radiateur est très sale comme s'il venait d'un chantier. Trace d'enduit dans les ailettes... Il y a une fuite en plein milieu entre deux éléments.
Achat/utilisation de quelques outils et consommables:
Ne pas oublier clé 6 pans pour fermer le T de réglage ☑️
Tournevis plat pour dépressuriser le radiateur ☑️
Chiffons + Papier de verre + Loctite 7235 ☑️
Fluorosilicone 16x1cm et 20x1cm ☑️
2x colliers de serrage métallique >16cm ☑️
Холодная сварка si la technique avec fluorosilicone ne fonctionne pas ☑️ non utilisé
Technique du sac plastique pour devier la fuite en attandant de réparer.
Circulation d'eau coupée aux deux té puis dépressurisation.
Nettoyage au tournevis pour enlever le plus gros.
Puis nettoyage avec une chaussette sèche, puis imbibée de Loctite 7235.
Installation du fluorosilicone puis serrage avec le collier métallique.
Remise en service.
Porte entrée :
On peut normallement fermer la porte depuis l'exterieur. Mais impossible de fermer à clé depuis l'interieur. Et le loquet une fois fermé est parfois très dur à ouvrir donc... enfermé à l'intérieur.
Achat/utilisation de quelques outils et consommables:
Huile pour le loquet ☑️
Le loquet a été sorti de la porte. Le mécanisme a été nettoyé et huilé. Nikel.
Les caches serrures ont été retirés et réajustés.
Salle de bain :
Achat/utilisation de quelques outils et consommables:
Vis pour tiroir ☑️
La planche du tiroir ne tenait plus très bien. Scotch double face retiré puis refixée avec 5 vis.
Nettoyage de la vitre de douche avec mélange grand-mère.
Le tuyau d'évacuation d'eau de la machine à laver fuyait. Le tuyau d'évacuation a été enfoncé plus profondément.
Ajustement chasse d'eau car il fallait maintenir le bonton appuyé pour faire couler l'eau. Deux petites pièces orange ont été retirées qui empechait d'enfoncer suffisamment le bouton pour déclencher et automaintenir la chasse d'eau.
He is presented two ways to manage a portfolio. One way to reach a 6-figures account (using ETF + LEAP option CALL), and a way to keep account growing in a slower way but taking emotions into account (using ETF + LEAP option CALL + LEAP option PUT).
Buy-and-Old is a very good startegy but there is a way to enhance it safely enough.
Travis tells to start the portfolio at any day of the year then to balance the portfolio every January.
He is using LEAP options (Long-term Equity Anticipation Securities (LEAPS) are a type of stock or index option with notably longer expiration dates as compared to standard options) expiring in December.
🔵 Managing the portfolio up to 100k
He is using SPY ETF + buying At The Money CALL option (to boost profit... in a bull market ⚠).
The allocation is the following :
80% to buy SPY
20% to buy SPY CALL ATM
As of today 12/09/2024 :
The furthest available SPY option is at expiration 18/12/2026.
CALL at 555 strike cost 74.65 USD so one CALL would cost 7465 USD.
20% of the portfolio is 10000 x 0.2 = 2000 USD
SPY seems too big to trade options for a small account.
An account of 37325 USD would buy 1 CALL.
SPY is trading at 555.29 USD => (37325 - 7465) / 555.29 = 53.8 shares to buy.
To be review in January 2025...
🔵 Managing the portfolio above 100k
To become richer up to 100k, you could invest agressively. But to stay rich you need to invest conservatively.
He is using SPY ETF + buying At The Money CALL option (to boost profit... in a bull market ⚠) + buying At The Money PUT option (as an insurance against losses and emotions).
Here is what you buy when you follow the enhanced buy & hold blueprint:
SPYbroad-based index fund in buy-and-old mode for safe and stable returns
PUT option as an insurance against the stock market
CALL option to pay for the PUT and to boost the returns
How you allocate?
One options controls 100 shares. So you would buy:
1 PUT and 1 CALL if you own between 0 and 150 shares of SPY
2 PUT and 2 CALL if you own between 151 and 250 shares of SPY
3 PUT and 3 CALL if you own between 251 and 350 shares of SPY
etc...
As of today 12/09/2024 :
The furthest available SPY option is at expiration 18/12/2026.
CALL at 555 strike cost 74.65 USD so one CALL would cost 7465 USD.
PUT at 555 strike cost 44.75 USD so one PUT would cost 4475 USD.
7465 + 4475 = 11940 USD
SPY is trading at 555.29 USD => (100000 - 11940) / 555.29 = 158.6 shares to own.
158 shares of SPY makes it 87735 USD or 87.7% of the portfolio.
1 PUT + 1 CALL makes it 11940 USD or 11.9 % of the portfolio.
The remaining money (324.18 USD) stay in cash (or less to pay the trading fees 😉).
Edit 18/01/2025:
P/L => ((101.72-74.65)+(30.10-44.75))*100+(597.58-555.29)*158 = + 7923.82 USD
Value after selling put and call => ((101.72)+(30.10))*100+(597.58)*158 = +107599.64 USD + 324.18 USD
As of today 18/01/2025 :
The furthest available SPY option is at expiration 17/12/2027.
CALL at 595 strike cost 106.66 USD so one CALL would cost 10666 USD.
PUT at 595 strike cost 50.0 USD so one PUT would cost 5000 USD.
10666 + 5000 = 15666 USD
SPY is trading at 597.58 USD => (107923.82 - 15666) / 597.58 = 154.4 shares to own.
Owned SPY shares : 158
Instead of selling shares I bring equivalent of 4 shares in cash : 4 x 597.58 => 2400 USD
Remaining Cash 230.50 USD
Edit 13/01/2026:
P/L => ((160.00-106.66)+(29.39-50.00))*100+(693.77-597.58)*158 = + 18471.02 USD versus 18/01/2025
Value after selling put and call => ((160)+(29.39))*100+(693.77)*158 = +128554.66 USD + 230.50 USD
As of today 13/01/2026 :
The furthest available SPY option is at expiration 20/01/2028.
CALL at 690 strike cost 94.45 USD so one CALL would cost 9445 USD.
PUT at 690 strike cost 55.11 USD so one PUT would cost 5511 USD.
9445 + 5511 = 14956 USD
SPY is trading at 693.77 USD => (128785.16 - 14956 ) / 693.77 = 164.07 shares to own.
Owned SPY shares : 158
No need to bring cash, need to only buy 6 more shares