Skip to content

Instantly share code, notes, and snippets.

View benjamin-dk's full-sized avatar

Benjamin Christensen benjamin-dk

  • Aarhus Universitetshospital
View GitHub Profile
@lelegard
lelegard / sftp-ls.sh
Created May 10, 2018 17:09
Script to recursively list, synchronize or delete directories on a remote site using SFTP only
#!/bin/bash
#-----------------------------------------------------------------------------
#
# This script recursively lists a remote directory using SFTP.
# It generates a deterministic output format, suitable for scripting.
# Syntax: see showhelp() function below.
#
#-----------------------------------------------------------------------------
#
# Copyright (c) 2018, Thierry Lelegard
@sveggiani
sveggiani / instructions.md
Last active July 15, 2023 21:52
[Configure XDebug, Visual Studio Code for a Vagrant VM] #debug #vm #vscode #masscode

Configure XDebug, Visual Studio Code for a Vagrant VM

1. Assumptions

  • Project (Drupal) is served on /var/www/html in the Vagrant box
  • Local project files location: c:\Users\username\Work\projects\my-project\repo\html
  • Guest machine IP is 10.0.2.2 (if this doesn't work, run route -nee in the VM and look for the gateway address)

2. Configuration

@luckydev
luckydev / gist:b2a6ebe793aeacf50ff15331fb3b519d
Last active October 22, 2022 14:03
Increate max no of open files limit in Ubuntu 16.04/18.04 for Nginx
# maximum capability of system
user@ubuntu:~$ cat /proc/sys/fs/file-max
708444
# available limit
user@ubuntu:~$ ulimit -n
1024
# To increase the available limit to say 200000
user@ubuntu:~$ sudo vim /etc/sysctl.conf
@noelboss
noelboss / git-deployment.md
Last active March 7, 2024 02:21
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@magnetikonline
magnetikonline / README.md
Last active November 27, 2023 21:12
Setting Nginx FastCGI response buffer sizes.
@arunk-s
arunk-s / backup.sh
Created April 13, 2014 06:36
Shell Script for taking Incremental Backup and store it at a remote place
# backup.sh
# The contents of this file are released under the GNU General Public License. Feel free to reuse the contents of this work, as long as the resultant works give proper attribution and are made publicly available under the GNU General Public License.
# By Arun Sori <arunsori94@gmail.com>
#For taking backup of the desired directory and store it at a remote place
#timestamp
time_stamp=`date`
#backup file name
@mwhite
mwhite / git-aliases.md
Last active April 22, 2024 09:22
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@toolmantim
toolmantim / Makefile
Last active December 5, 2022 23:14
An example of using Make instead of Grunt for fast, simple and maintainable front-end asset compilation.
# A simple Makefile alternative to using Grunt for your static asset compilation
#
## Usage
#
# $ npm install
#
# And then you can run various commands:
#
# $ make # compile files that need compiling
# $ make clean all # remove target files and recompile from scratch
@mankyKitty
mankyKitty / ExportingViews.md
Last active August 22, 2016 13:23
Guide to exporting Views in Drupal 6/7 into your module so you can keep them safe in version control. You *ARE* using version control right?

Exporting Views

This guide assumes you have a module ready to save the views but it does not have any Views integration or folder structure. Skip ahead if you've already created the folders and Views Hooks.

  • Add the views folder to your module.
  • Create a file called MODULENAME.views.inc inside the views folder.
  • Add a default_views folder inside the views folder.

Your module directory structure should now resemble something like this: