Skip to content

Instantly share code, notes, and snippets.

@tknv
tknv / my_vscode_extensions.sh
Created July 19, 2022 15:06
vs code extensions
code --install-extension aaron-bond.better-comments
code --install-extension akamud.vscode-theme-onelight
code --install-extension austin.code-gnu-global
code --install-extension batisteo.vscode-django
code --install-extension bilalekrem.scenebuilderextension
code --install-extension blackmist.LinkCheckMD
code --install-extension bowlerhatllc.vscode-as3mxml
code --install-extension cschlosser.doxdocgen
code --install-extension Dart-Code.dart-code
code --install-extension Dart-Code.flutter
sudo apt install rsyslog
sudo vim /etc/rsyslog.conf
module(load="imtcp") # needs to be done just once
input(type="imtcp" port="514")
$template FILENAME,"/var/log/%HOSTNAME%/syslog.log"
*.* ?FILENAME
...
#!/bin/bash
# set values for certificate
#
# CA - Certificate Authority
# countryName two letter code
CA_C="NR"
# stateOrProvinceName
CA_ST="Yaren"
# localityName
@tknv
tknv / telnet
Created March 11, 2020 06:02
/etc/xinetd.d/telnet
service telnet
{
disable = no
socket_type = stream
protocol = tcp
port = 23
user = root
wait = no
instances = 10
from twisted.internet import reactor
from twisted.web.server import Site
from twisted.web.resource import Resource
import json, hmac
from hashlib import sha1
from blinker import signal
class WebhookServer(Resource):
@media (min-width:320px) { /* smartphones, iPhone, portrait 480x320 phones */ }
@media (min-width:481px) { /* portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide. */ }
@media (min-width:641px) { /* portrait tablets, portrait iPad, landscape e-readers, landscape 800x480 or 854x480 phones */ }
@media (min-width:961px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
/* source https://stackoverflow.com/questions/6370690/media-queries-how-to-target-desktop-tablet-and-mobile */
- Get OpenBSD from http://www.openbsd.org/ ;)
- Find an Ubuntu cloud image on https://cloud-images.ubuntu.com/
- Get https://github.com/reyk/meta-data and configure it for cloud-init
- Run the VM ...
Script started on Thu Mar 30 01:53:50 2017
# qemu-img convert ubuntu-16.10-server-cloudimg-amd64.img ubuntu-16.10-server-cloudimg-amd64.raw
# vmctl start ubuntu -d ubuntu-16.10-server-cloudimg-amd64.raw -n nat -c
Connected to /dev/ttyp6 (speed 9600)
Changing serial settings was 0/0 now 3/0

Keybase proof

I hereby claim:

  • I am tknv on github.
  • I am tknv (https://keybase.io/tknv) on keybase.
  • I have a public key ASCsFH9kgNO09OOEj5JAAz1WlctjHBAckhM7RafTlpNOHwo

To claim this, I am signing this object:

@tknv
tknv / arp-vendor.sh
Created October 10, 2017 08:22
add vendor name to arp
#!/bin/bash
if [ ! -f ./oui.txt ]; then
echo -n "oui.txt not found. start download (y/n)? "
read answer
if echo "$answer" | grep -iq "^y"; then
wget http://standards-oui.ieee.org/oui.txt
else
exit
fi
fi
@tknv
tknv / bash loop.sh
Created September 6, 2017 08:11
bash loop
while true; do foo; sleep 2; done