Skip to content

Instantly share code, notes, and snippets.

View bpetrynski's full-sized avatar

Bartosz Petryński bpetrynski

View GitHub Profile
@PackeTsar
PackeTsar / byobu-ssh-cheatsheet.md
Last active May 29, 2024 07:13
Byobu (over SSH) Cheat Sheet

Byobu (over SSH) Cheat Sheet

I often find myself using Byobu on a Linux machine when connected to it over SSH. In doing so, I've noticed that many of the documented keyboard shortcuts don't work. This can be due to the native PC's OS intercepting certain keys, or possibly other reasons.

Below is a cheatsheet with Byobu features I have found usually work when run over a SSH connection.

Action Windows + Putty to Ubuntu MacOS + Terminal to Ubuntu
Help menu BASH: byobu-config FN-F1
Create new window CTRL-a c CTRL-a c or FN-F2
@lancethomps
lancethomps / close_notifications_applescript.js
Last active June 18, 2024 19:51
AppleScript to close all notifications on macOS Big Sur, Monterey, and Ventura
function run(input, parameters) {
const appNames = [];
const skipAppNames = [];
const verbose = true;
const scriptName = "close_notifications_applescript";
const CLEAR_ALL_ACTION = "Clear All";
const CLEAR_ALL_ACTION_TOP = "Clear";
@XLNCs
XLNCs / AdobeFixAMD
Last active March 21, 2024 15:33
To fix adobe products crashes on AMD hackintosh
MOVED HERE:
https://gist.github.com/naveenkrdy/26760ac5135deed6d0bb8902f6ceb6bd
@arturmartins
arturmartins / mac-upgrade.sh
Last active June 11, 2024 10:36
How to keep your mac software updated easily (2024)
#!/bin/bash
# Requirements:
# - homebrew: https://brew.sh/
# - homebrew tap: buo/cask-upgrade - https://github.com/buo/homebrew-cask-upgrade
# - homebrew mas (Mac App Store command-line interface - https://github.com/mas-cli/mas)
#
# Install the requirements by running:
# brew tap buo/cask-upgrade && brew install mas
# CONFIG:
@vviikk
vviikk / Importing-Markdown-into-Medium-a.k.a-write-your-articles in-Markdown.md
Created November 15, 2018 10:20
Importing Markdown into Medium a.k.a write your articles in Markdown

The Medium editor is great and it will get better.Medium has taken the world by storm and I spend a lot of time absorbing all the great information here.

However, there's one drawback. I would like to write my articles offline. And also, even when online, I'd want something more minimal to write my articles - fast. I'm a command-line junkie and take my notes via sncli - a simple note client that is awesome, and allows me to use my favorite text editor - Vim. On the Mac, I use nvAlt

The original way, that used to work, doesn't anymore. I tried it and Medium imported nothing than the heading. Now, Medium's import is looking for a URL, which I assume is parsing as a HTML Document.

Copy / paste method

You will need to either:

  • convert your Markdown to HTML first. Copy & paste it into your article.
  • use many of markdown editors that have a preview mode. Copy that, and paste it in.
@CyberPunkCodes
CyberPunkCodes / killadobe.sh
Last active November 21, 2022 16:41
Mac Bash script to kill Adobe Create Cloud and other processes that Adobe forces on us.
#!/bin/bash
echo "\n\n--- Killing Stupid Adobe Auto Load Crap ---\n\n"
launchctl unload -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist
launchctl unload -w /Library/LaunchAgents/com.adobe.AAM.Updater-1.0.plist
echo "\n\n--- Done! ---\n\n"
@gagarine
gagarine / install-clamav-osx.md
Last active June 10, 2024 15:36
Howto Install clamav on OSX with brew

Howto Install clamav on OSX with brew

Note: on legacy intel system the path may be /usr/local/etc/clamav instead of /opt/homebrew/etc/clamav/

$ brew install clamav
$ cd /opt/homebrew/etc/clamav/
$ cp freshclam.conf.sample freshclam.conf
@joaofraga
joaofraga / readme.md
Created November 24, 2015 17:37
Bootable Windows USB from Mac OSX (Terminal)

How to create an Bootable Windows USB from OSX without Bootcamp

You will need

  • USB SSD with at least 8GB
  • Windows .ISO

With this on hands

Open terminal and do the following:

@BlakeGardner
BlakeGardner / compact.js
Last active February 19, 2024 16:55
Compact all collections inside of a MongoDB database
// This script loops though the list of collection names in a MongoDB and runs the compact operation on them
// Simply paste this into the Mongo shell
use testDbName;
db.getCollectionNames().forEach(function (collectionName) {
print('Compacting: ' + collectionName);
db.runCommand({ compact: collectionName });
});
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>