Skip to content

Instantly share code, notes, and snippets.

Avatar
😀

Rogerio Prado de Jesus rogeriopradoj

😀
View GitHub Profile
@lpar
lpar / README.md
Last active Oct 9, 2020
How to make Hugo (0.20+) generate an Atom feed instead of RSS
View README.md

The Hugo static site generator sadly still uses the obsolete and badly standardized RSS format.

Here's how to set it up to generate an Atom feed instead. Pretty much all feed readers which understand RSS also understand Atom, except iTunes, and Atom is a better format.

  1. Define an appropriate media type and corresponding output format in config.toml:
@BretFisher
BretFisher / docker-for-mac.md
Last active Nov 20, 2020
Getting a Shell in the Docker for Mac Moby VM
View docker-for-mac.md

2018 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Moby VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@w00fz
w00fz / sphp.sh
Last active Nov 27, 2020
PHP switcher
View sphp.sh
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
@zenorocha
zenorocha / etc-hosts-on-win.md
Last active Nov 9, 2020
/etc/hosts on Windows
View etc-hosts-on-win.md

1. Get your IP Address

echo `ifconfig $(netstat -nr | grep -e default -e "^0\.0\.0\.0" | head -1 | awk '{print $NF}') | grep -e "inet " | sed -e 's/.*inet //' -e 's/ .*//' -e 's/.*\://'`

2. Modify your hosts file

notepad

@evanwill
evanwill / gitBash_windows.md
Last active Nov 20, 2020
how to add more utilities to git bash for windows, wget, make
View gitBash_windows.md

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

@helderco
helderco / db-open
Created Oct 6, 2015
Script to open a mysql database in Sequel Pro from a service in docker-compose.
View db-open
#!/bin/bash
set -e
show_help() {
cat << EOF
Usage: ${0##*/} [-u USER] [-p PASS] [-P PORT] [-H HOST] [DATABASE]
${0##*/} -h
Open a standard connection in Sequel PRO.
@PurpleBooth
PurpleBooth / README-Template.md
Last active Nov 27, 2020
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@scalopus
scalopus / common-config.sh
Created Feb 27, 2015
php-build-common-config
View common-config.sh
#!/bin/bash
# Copy this file to ./php-build/share/php-build/after-install.d
# This file is to keep all minors version use the same configuration file.
# This will required you to install the base version.
# Ex.
# 5.4.10 use 5.4.0 as configuration
# you have to install 5.4.0 at first.
View setup-modernie-vagrant-boxes.md

Setup modern.ie vagrant boxes

Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.

However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.

Pre-requisites

@domenic
domenic / 0-github-actions.md
Last active Nov 25, 2020
Auto-deploying built products to gh-pages with Travis
View 0-github-actions.md

Auto-deploying built products to gh-pages with GitHub Actions

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:

  • It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
  • It is free, with no quotas.
  • Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
You can’t perform that action at this time.