Skip to content

Instantly share code, notes, and snippets.

Avatar

Muffy B. Tepperman evokateur

  • "I’m going to ignore that
  • because, frankly, I don't get it"
View GitHub Profile
@n8finch
n8finch / wp-strictly-mu-plugins-plugins-themes-gitignore
Last active Jun 26, 2021
This gitignore will ignore anything that isn't in mu-plugins, plugins, and themes directories of your wp-content directory.
View wp-strictly-mu-plugins-plugins-themes-gitignore
# Ignore everything in the root except the "wp-content" directory.
/*
!.gitignore
!wp-content/
# Ignore everything in the "wp-content" directory, except the "mu-plugins", "plugins", and "themes" directories.
wp-content/*
!wp-content/mu-plugins/
!wp-content/plugins/
!wp-content/themes/
@n8finch
n8finch / no-wp-core-gitignore
Created Dec 16, 2020
This is a gist for to ignore WordPress core files, and some other selected files.
View no-wp-core-gitignore
*~
.DS_Store
.svn
.cvs
*.bak
*.swp
Thumbs.db
# wordpress specific
wp-config.php
@gabrielelana
gabrielelana / Vagrantfile
Last active Feb 6, 2021
How to create a VirtualBox machine with encrypted storage with Vagrant
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
PASSWORD_PATH = ".password"
PASSWORD_ID_PATH = ".password_id"
# Make sure to have installed vagrant-triggers plugin
# > vagrant plugin install vagrant-triggers
# After the first `vagrant up` stop the VM and execute the following steps
@MCF
MCF / sqlsrv_test.php
Last active Jun 13, 2021
PDO sqlsrv PHP driver, connect and query SQL Server database - reduced test case.
View sqlsrv_test.php
<?php
$serverName = "sqlserver.example.com";
$database = "myDbName";
$uid = 'sqlserver_username';
$pwd = 'password';
try {
$conn = new PDO(
"sqlsrv:server=$serverName;Database=$database",
$uid,
@int128
int128 / post.md
Last active Aug 7, 2021
How to use Ruby on Cygwin
View post.md

How to use Ruby on Cygwin

It is strongly recommended to run on Linux or OS X. Maybe many problems will happen.

Prerequisite

  • Cygwin
  • apt-cyg
  • http_proxy is set if needed
@scy
scy / opening-and-closing-an-ssh-tunnel-in-a-shell-script-the-smart-way.md
Last active May 17, 2022
Opening and closing an SSH tunnel in a shell script the smart way
View opening-and-closing-an-ssh-tunnel-in-a-shell-script-the-smart-way.md

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost