Skip to content

Instantly share code, notes, and snippets.

@Fire-Dragon-DoL
Fire-Dragon-DoL / 00-throttle-zoom
Last active June 29, 2023 14:51 — forked from abraithwaite/chill-zoom.sh
FEDORA version - Zoom in Systemd Cgroups on Linux. Change the max allocations to fit your workstation.
#!/usr/bin/env bash
# throttle-zoom '0-1' '6G'
set -xe
main() (
allowedCpus="${1?Missing allowed CPUs, ex: 0-4}"
maxMemory="${2?Missing max memory, ex: 6G}"
@abraithwaite
abraithwaite / chill-zoom.sh
Last active December 12, 2024 09:16
Zoom in Systemd Cgroups on Linux. Change the max allocations to fit your workstation.
#!/usr/bin/bash -xe
cat <<EOF > "${HOME}/.config/systemd/user/zoom.slice"
[Slice]
AllowedCPUs=0-4
MemoryHigh=6G
EOF
cat /usr/share/applications/Zoom.desktop | sed -E 's#^(Exec=).*$#Exec=/usr/bin/systemd-run --user --slice=zoom.slice /opt/zoom/ZoomLauncher#' > "${HOME}/.local/share/applications/Zoom.desktop"
@sanampatel
sanampatel / laravel_migration.txt
Created July 29, 2019 19:45
Commands to run after Laravel git clone or after project migration
#Clone your project from git
composer install
npm install
copy .env.example .env
OR
cp .env.example .env
php artisan key:generate
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active March 13, 2025 01:41
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@dayreiner
dayreiner / log-all-zsh-bash-commands-syslog.md
Last active August 1, 2024 04:59
Log all users zsh / bash commands via syslog without 3rd-party tools or auditd

Sending Bash and ZSH Commands to Syslog

Also posted here: http://18pct.com/sending-bash-and-zsh-commands-to-syslog/

Your bash/zsh history is great if its complete, but it doesn't capture commands across all users, sudo's, root commands etc. In particular with test environments, someone may perform a "one-off" procedure and then months later it needs to be repeated. It would be nice to be able to look up what the user did at the time, and searching through multiple, possibly truncated history files is a pain.

Tools like typescript are great if you're actively documenting, but not something you would use all the time in practice and capture more than just a history of your commands. There are third-party tools like rootsh and Snoopy that can accomplish this, but third-party tools can be overkill if all you want is a quick reference in a re

@yograterol
yograterol / gist:99c8e123afecc828cb8c
Created January 8, 2016 05:45
"gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory" workaround
"gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory" CentOS's and Fedora +22 workaround
Install `redhat-rpm-config`
$ sudo dnf install redhat-rpm-config
@guiassemany
guiassemany / git-discard-all-and-pull.md
Created December 20, 2015 19:17
GIT - Discard all local changes and pull

git discard all local changes/commits and pull from upstream

  • git reset --hard origin/master
  • git pull origin master