Skip to content

Instantly share code, notes, and snippets.

View willnaoosmith's full-sized avatar
🐧
Torvalds take the wheel 🙏🏻

William Brochensque Júnior willnaoosmith

🐧
Torvalds take the wheel 🙏🏻
View GitHub Profile
@willnaoosmith
willnaoosmith / gist:9778445ee355f642852e95fb290627c9
Last active January 24, 2024 11:04
Powershell script to turn off all computers on a OU that is not on a ignore List
Import-Module active*
$ignoreList = @(
"PC-XXXX",
"PC-YYYY"
)
$rtn = $null
Get-ADComputer -Filter * -SearchBase "OU=COMPUTERS,OU=XXX,DC=DOMAINHERE,DC=local" |
ForEach-Object {
@willnaoosmith
willnaoosmith / gist:4e42c29903ce12cdda04478210f30a5b
Last active January 24, 2024 11:03
powershell script to send message to all users on a OU except some that are on a IgnoreList
Import-Module active*
$msg = "YOUR MESSAGE HERE"
$rtn = $null
$ignoreList = @(
"PC-XXXX.DOMAINHERE.local",
"PC-YYYY.DOMAINHERE.local",
)
Get-ADComputer -Filter * -SearchBase "OU=COMPUTERS,OU=PARENTouHERE,DC=DOMAINHERE,DC=local" |
@willnaoosmith
willnaoosmith / JsonToCSV.py
Created November 28, 2023 19:39
convert a json file to CSV
import json, csv
try:
with open("dataset.json") as file:
data = json.load(file)
except:
try:
data = [json.loads(line) for line in open('dataset.json', 'r')]
@willnaoosmith
willnaoosmith / gist:8d9ba3142e6ce3cba140ae8bbbbcfbbc
Created October 24, 2023 12:04
style the scrollbar only on google chrome
::-webkit-scrollbar {
width: 20px;
}
::-webkit-scrollbar-track {
background-color: transparent;
}
::-webkit-scrollbar-thumb {
@willnaoosmith
willnaoosmith / gist:7daf708bf91bbb33b52f0974793d72d5
Created September 15, 2023 17:50
disable packagekitd debian
sudo systemctl stop packagekit
sudo systemctl mask packagekit
dpkg-divert --divert /etc/PackageKit/20packagekit.distrib --rename /etc/apt/apt.conf.d/20packagekit
@willnaoosmith
willnaoosmith / gist:50608206d73f15de265748325912573c
Created September 1, 2023 11:22
print specific line of file
sed -n 'lineNumberp' file.txt
@willnaoosmith
willnaoosmith / logrotateConfig
Created August 31, 2023 13:59
rotate linux system logs
nano /etc/logrotate.d/system.conf
/var/log/*.log {
weekly
copytruncate
rotate 1
size 10M
compress
}
@willnaoosmith
willnaoosmith / java_download.sh
Created August 25, 2023 13:56 — forked from wavezhang/java_download.sh
download java from oracle without login
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz
@willnaoosmith
willnaoosmith / pythonShellOnGrub.md
Created August 24, 2023 13:41
run python shell on grub boot

first, edit your grub config:

nano /boot/grub/grub.cfg

second, add rw init=/usr/bin/python to the boot entry:

[...]
menuentry 'Your entry Here' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-69' {
@willnaoosmith
willnaoosmith / gist:3e18f1f93ad705d270694ef24945460f
Created August 24, 2023 11:36
find external ip address on linux
curl checkip.amazonaws.com
curl ifconfig.me
curl icanhazip.com
curl ipecho.net/plain
curl ifconfig.co