Skip to content

Instantly share code, notes, and snippets.

@qosmio
qosmio / useful-one-liners.sh
Created April 28, 2023 08:36 — forked from johnnypea/useful-one-liners.sh
Useful one liners
# Run the last command as root
sudo !!
# Serve current directory tree at http://$HOSTNAME:8000/
python -m SimpleHTTPServer
# Save a file you edited in vim without the needed permissions
:w !sudo tee %
# change to the previous working directory
cd -
# Runs previous command but replacing
^foo^bar
@qosmio
qosmio / hax.sh
Created November 5, 2022 06:49 — forked from iGlitch/hax.sh
macOS provisioning, hardening, tweaking, whatever script - no more phone home
#!/bin/bash
# Let's "secure" even the script for you :)
sudo -v
function ok() {
echo -e "[OK] "$1
}
function bot() {
@qosmio
qosmio / Disable-Ventura-Bloatware.sh
Created November 5, 2022 02:30 — forked from b0gdanw/Disable-Ventura-Bloatware.sh
Disable Ventura Bloatware
#!/bin/zsh
#Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3
#Disabling unwanted services on macOS 13 Ventura
#Disabling SIP is required ("csrutil disable" from Terminal in Recovery)
#Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist, disabled.501.plist
#To revert, delete /private/var/db/com.apple.xpc.launchd/ disabled.plist & disabled.501.plist and reboot
# user
@qosmio
qosmio / iwchan.awk
Created January 13, 2021 20:36
Select wireless channel automatically
#!/usr/bin/awk -f
# Coded by: Vladislav Grigoryev <vg[dot]aetera[at]gmail[dot]com>
# License: GNU General Public License (GPL) version 3+
# Description: Select wireless channel automatically
function get_iwphy() {
cmd = "iw phy"
while(cmd | getline) {
if($0 ~ /^\s*Wiphy\s/)
@qosmio
qosmio / README.md
Created July 25, 2020 19:17 — forked from joyrexus/README.md
Perl one-liners

Hi:

perl -e 'print "hello world!\n"'

A simple filter:

perl -ne 'print if /REGEX/'

Filter out blank lines (in place):