Skip to content

Instantly share code, notes, and snippets.

View pdostal's full-sized avatar
:octocat:

Pavel Dostál pdostal

:octocat:
View GitHub Profile

Paste text on VNC terminal that don't allow copy-paste

  • Prepare script on terminal
  • Copy data
  • Run script
  • Move focus to destination target
  • Script will 'type' for you
@shamil
shamil / mount_qcow2.md
Last active May 27, 2024 10:36
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@dakatsuka
dakatsuka / mailcatcher.sh
Created December 15, 2013 10:57
/etc/init.d/mailcatcher
#!/bin/bash
PID_FILE=/var/run/mailcatcher.pid
NAME=mailcatcher
PROG=/opt/rbenv/versions/1.9.3-p484/bin/mailcatcher
USER=mailcatcher
GROUP=mailcatcher
start() {
echo -n "Starting MailCatcher"
@zenorocha
zenorocha / multiple-3rd-party-widgets.js
Last active November 14, 2022 12:18
Loading multiple 3rd party widgets asynchronously
(function() {
var script,
scripts = document.getElementsByTagName('script')[0];
function load(url) {
script = document.createElement('script');
script.async = true;
script.src = url;
scripts.parentNode.insertBefore(script, scripts);
@Crhistoph
Crhistoph / .msmtprc
Created July 14, 2012 23:38
Fastmail and msmtp
account default
host mail.messagingengine.com
from myuser@mydomain.com
auth on
user username@fastmail.fm
password password
tls on
tls_trust_file /usr/share/ca-certificates/mozilla/DigiCert_High_Assurance_EV_Root_CA.crt
@rstacruz
rstacruz / index.md
Last active November 3, 2023 09:56
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

@brentertz
brentertz / rvm2rbenv.txt
Created November 21, 2011 23:00
Switch from RVM to RBENV
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################