Skip to content

Instantly share code, notes, and snippets.

@s3rj1k
s3rj1k / HowTo
Last active March 6, 2024 12:12
Ubuntu 20.04.3 AutoInstall
# For recent versions of Ubuntu:
- https://www.pugetsystems.com/labs/hpc/ubuntu-22-04-server-autoinstall-iso/
# Docs:
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls/ConfigReference
- https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
- https://discourse.ubuntu.com/t/please-test-autoinstalls-for-20-04/15250/53
# Download ISO Installer:
@mosquito
mosquito / README.md
Last active May 24, 2024 17:00
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@cimmanon
cimmanon / psql.md
Created May 2, 2017 17:22
PostgreSQL cheat sheet for MySQL users

I use PostgreSQL via the psql client. If you use a different client (eg. pgAdmin, etc.), I don't know how much will translate over.

One nice difference between psql and mysql (cli) is that if you press CTRL+C, it won't exit the client.

User administration

Login as superuser (via shell)

psql -U postgres
@jonschlinkert
jonschlinkert / open-iterm-from-finder.md
Last active May 24, 2022 01:33
Add an icon to your finder toolbar to open iTerm in the current folder.

Open iTerm from finder

The code and instructions in this gist are from http://peterdowns.com/posts/open-iterm-finder-service.html. I've had to do this a few times and wanted to distill it the basics.

  1. Open Automator
  2. Create an Application
  3. Choose Actions > Utilities > Run Applescript
  4. Paste the contents of open_in_iterm.app into the window.
  5. Save the script somewhere convenient
  6. Find the script, then drag the script onto the Finder window while holding the command key (or in Yosemite, the command + option keys)
@kurozumi
kurozumi / gist:71280c121d7f0f21041b2d13bc4891b4
Last active April 9, 2016 21:19
SSHの不正なアクセス数を集計するコマンド
$ sudo lastb | awk '{print $1}' | sort | uniq -c | sort -nr | head -n 30
@rupakraj
rupakraj / last-lastb
Created February 26, 2016 09:19
Handy Shell Commands for checking SSH Access using last, lastb, sed
# lastb : Unsuccessful attempts
# last : Successful attempts
sudo lastb | sed 's/ \+/ /g'| cut -d' ' -f3 | sort | uniq -c | sort -n
sudo last | sed 's/ \+/ /g'| cut -d' ' -f3 | sort | uniq -c | sort -n
@wrouesnel
wrouesnel / zed.service
Last active July 11, 2023 19:25
systemd unit files for ZFS
[Unit]
Description=ZFS Event Daemon (zed)
Documentation=man:zed(8)
After=zfs-import-cache.service
After=zfs-import-scan.service
[Service]
Type=forking
ExecStart=/sbin/zed
PIDFile=/run/zed.pid
@OrganicIrradiation
OrganicIrradiation / hb_batchconvertvideos.py
Created February 8, 2015 13:48
hb_batchconvertvideos
import os
import time
import subprocess
import sys
fileList = []
rootdir = raw_input("Root Dir: ")
for root, subFolders, files in os.walk(rootdir):
for file in files:
theFile = os.path.join(root,file)
@jtyr
jtyr / VirtualBoxKickstart.md
Last active February 23, 2024 01:38
How to use kickstart in VirtualBox

How to use kickstart in VirtualBox

This short howto describes how to install VMs via kickstart in VirtualBox. It's using PXE functionality built into the NAT network mode of the VirtualBox. The following instructions apply to CentOS installation but it should work for any RedHat-based distro.

Prepare directory structure

@limamedeiros
limamedeiros / gist:ecdb439f79b1d19524f4
Last active August 29, 2015 14:10
Opens Safari's current tab in a new private window and closes the tab. If a private window already exists, then opens the current tab in that window.
tell application "Safari"
activate
set theURL to the URL of the current tab of the front window
close current tab of front window
end tell
tell application "Safari"
activate
set theWindow to false
repeat with w in (every window whose visible is true)