Skip to content

Instantly share code, notes, and snippets.

@womd
womd / gist:8f6933731cd6a6e67297d41b7507bf9e
Last active February 23, 2024 14:51
linux install cheatsheet - things i need every now and then
#required for host command
sudo apt-get install bind9-host -y
# update IP to KeyValue-Store
# ! chmod +x !
#/opt/updateIP.sh:
#!/bin/sh
IP=$(host myip.opendns.com resolver1.opendns.com | tail -n1 | awk '{ print $4 ; exit }')
@womd
womd / gist:de7c77932a23cce27b4e85a4b41ecc01
Created January 16, 2024 16:07
linux vm - grow / resize partition to max out space
#Check Logical Volume (LV) details:
sudo lvdisplay
#Look for the LV path associated with your root filesystem (e.g., /dev/ubuntu-vg/ubuntu-lv).
sudo lvresize -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
#Resize the Filesystem
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
#confirm
@womd
womd / setup.sh
Created January 16, 2024 15:01
ubuntu localAI docker notes
#!/bin/bash
#remove any conflicting packages
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
@womd
womd / letsencryptiisremotecertificatecreationmanualmode
Last active March 22, 2018 10:21
Using LetsEncrypt with ASP MVC - manual mode
- certificate creation on another machine than the webhost
- need some linux (deb/ubuntu):
apt-get install certbot
command:
cartbot certonly --manual //to start acme-challenge
- place the file from promt with content in prompted directory on server
+ add a web.config to that directory with following content:
@womd
womd / acccept_subdomain_routes in asp mvc
Created February 25, 2016 19:05
accept subdomain routes in asp mvc 5,6
summary:
goal is to accept routes for subdomains and return some specific stuff from db
e.g:
glossar.xyz.de -> lexikon.hepf.com/Service/getGlossar/(service_guid)
where service_guid is query's from db because of some entry indicating glossar.xyz.de is from that service-guid
start:
http://stackoverflow.com/questions/278668/is-it-possible-to-make-an-asp-net-mvc-route-based-on-a-subdomain
@womd
womd / gist:160c23bea51ebc4235ae
Created February 10, 2016 08:43
attack attemtps - samples from apache logs - ev build fail2ban rules or strainghten mod-security
[REMOTE CODE EXECUTION VIA HEADER]
[Wed Feb 10 07:36:12 2016] [error] [client 84.2.197.187] Invalid URI in request HEAD towards the green fields outside. Watch the goats chewing the grass. What is the meaning of life? Life isn't about getting to the end. Goats know this. You should know too. Goats are wise. Goats are cute. Listen to them! This is the message. Love goats, love the Internet! \xf0\x9f\x90\x90 Kecske. HTTP/1.0
[maliciously crafted request designed to execute arbitrary code on the server by causing a heap overflow in php.
a server limit has been exceeded such as number or length of request header field(s).]
error log:
[Wed Feb 10 00:55:33 2016] [error] [client 185.87.121.69] request failed: error reading the headers
corresponding access log:
@womd
womd / Apache 2 mod_cband notes
Created February 8, 2016 20:25
Setup notes for mod_cban
userful docs:
build info: http://www.34m0.com/2011/12/installing-and-configuring-cband-for.html
configuration: http://dembol.org/blog/mod_cband/faq/
cerators page: http://dembol.org/blog/mod_cband/ (some links down )
download from:
wget http://downloads.sourceforge.net/project/cband/mod-cband/mod-cband-0.9.6.1/mod-cband-0.9.6.1.tgz
other resources:
http://ubuntuforums.org/archive/index.php/t-899897.html - thead that showed th solution