Skip to content

Instantly share code, notes, and snippets.

@andkirby
andkirby / php-git-bash-win.sh
Last active December 31, 2023 12:21
Download PHP binaries archive on Windows from GitBash console or similar
#!/usr/bin/env bash
################################################################################
# This script can install PHP binaries on Windows in Bash.
#
# Link to this file:
# https://gist.github.com/andkirby/67e87e319c376b8676d559edb759e3fe/raw/php-git-bash-win.sh
#
# Download latest version by command in GitBash Windows console:
# $ curl -Ls bit.ly/php-bash-win | bash
#
@ppmathis
ppmathis / debian-stretch-fde.md
Last active May 21, 2024 04:05
Guide which explains an installation of Debian Stretch with full disk encryption (including "/boot" partition, containing initramfs+kernel) by using Debian Jessie Live.

Debian Stretch - Full Disk Encryption

This documents guides you through the process to install Debian Stretch with Full Disk Encryption. The following requirements exist:

  • Mainboard with UEFI-Support
  • Debian Stretch Live CD booted from UEFI
  • Two unformatted, unpartitioned HDDs/SSDs for Software RAID1 with mdmadm

After following this guide, you will end up with a setup like this:

  • Redundant GRUB Standalone EFI installation on both disks
@mamemomonga
mamemomonga / MariaDBInstall.sh
Last active April 27, 2017 21:09
Install MariaDB Client 10.1 for Debian8, Ubuntu 16.04
#!/bin/bash
# ----------
# Install MariaDB Client 10.1 for Debian8, Ubuntu 16.04
# curl -L https://gist.githubusercontent.com/mamemomonga/2823ecc2b20b886e90d1b8d523515724/raw/MariaDBInstall.sh | sudo bash -eux
# ----------
set -eux
if [ `id --user` -ne 0 ]; then
echo "rootでの実行が必要"
exit 255
@bocharsky-bw
bocharsky-bw / pr.md
Created February 2, 2017 16:43 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@monkeymonk
monkeymonk / jquery.scrollToTop.js
Created April 8, 2016 08:26
ES6 jQuery plugin definition
import $ from 'jquery';
import plugin from './plugin';
class ScrollToTop {
constructor(element, options) {
const $element = $(element);
$(window).scroll(function () {
if ($(this).scrollTop() > options.offset) {
$element.fadeIn();
@emarsk
emarsk / xorg_depgraph.dot
Last active March 8, 2021 11:28
Xorg graphviz dependency graph, as in BLFS book. To generate the image: "dot -Tpng xorg_depgraph.dot >xorg_depgraph.png".
// Xorg dependency graph (dot)
// BLFS 7.8
//
// style=solid : required
// style=dashed : recommended
// style=dotted : optional
// style=solid arrowhead=dot color=grey : required at runtime
strict digraph xorg {
label="Xorg dependencies
@bueckl
bueckl / wget
Last active October 11, 2023 08:05
Wget examples
#Spider Websites with Wget – 20 Practical Examples
Wget is extremely powerful, but like with most other command line programs, the plethora of options it supports can be intimidating to new users. Thus what we have here are a collection of wget commands that you can use to accomplish common tasks from downloading single files to mirroring entire websites. It will help if you can read through the wget manual but for the busy souls, these commands are ready to execute.
1. Download a single file from the Internet
wget http://example.com/file.iso
2. Download a file but save it locally under a different name
wget ‐‐output-document=filename.html example.com
@bocharsky-bw
bocharsky-bw / upgrade.sh
Last active October 17, 2024 09:02
Shell Script for Upgrade Ubuntu via APT in one step
#!/bin/bash
TEXT_RESET='\e[0m'
TEXT_YELLOW='\e[0;33m'
TEXT_RED_B='\e[1;31m'
sudo apt-get update
echo -e $TEXT_YELLOW
echo 'APT update finished...'
echo -e $TEXT_RESET
@acolyer
acolyer / service-checklist.md
Last active July 10, 2024 05:13
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?