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/bash -v | |
VAR="some notification" | |
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Title","message":"'$VAR'"},"id":1}' http://10.1.1.5:80/jsonrpc |
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
ps -ef | awk '$6=="?"&&$8~/^(\/bin\/)?(ba|da|z|k|c|tc)*sh-?/{print}' |
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
ss -f link -n -l -p |
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/bash | |
# | |
# Writing to this will cause the kernel to | |
# free pagecache, dentries and inodes. | |
# This causes that memory to become free. | |
# | |
# non-destructive & safe for production: | |
# ref: https://www.kernel.org/doc/Documentation/sysctl/vm.txt | |
freebefore=`free -k | awk '/^Mem:/{print $4}'` |
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
--- | |
# everything needed for n0de.cloud Hugo web dev | |
# | |
# $ ansible-playbook webdev_playbook.yml -i localhost | |
- name: hugo webdev complete | |
hosts: localhost | |
connection: local |
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
pi@host:~ $ curl -X GET --unix-socket /opt/path/some.socket http/hello/curltest | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Hello from flask</title> | |
<link rel="stylesheet" type="text/css" href="/static/style.css"> | |
</head> | |
<body> | |
<h1>Hello curltest!</h1> | |
</body> |
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
Setuid reboot wrapper script | |
The reboot_setuid.c file (11 lines): | |
``` | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/types.h> | |
#include <unistd.h> |
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
# ~/.screenrc | |
# | |
# look and feel | |
caption always "%{= bb}%{+b w}%h ${USER}@%H %= %c %{=b rw} %l %{= db}%{= dg}" | |
hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<" | |
# | |
# skip the startup message | |
startup_message off | |
# | |
# go to home dir |
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/bash | |
apt-get install -y ufw; | |
# default | |
ufw default deny outgoing | |
ufw default deny incoming | |
# inbound | |
ufw allow 8080/tcp |
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
sudo sh -c "echo none > /sys/class/leds/beaglebone\:green\:usr0/trigger" |
OlderNewer