Skip to content

Instantly share code, notes, and snippets.

@mikedamoiseau
mikedamoiseau / gist:c4a7b92cf831b32fbe4a5a0f0e878c5c
Last active July 6, 2017 03:23
Alias to ssh with password
1. Install sshpass `sudo apt-get update && sudo apt-get install sshpass`
2. edit file `~/.bash_aliases`
3. add the line `alias name_of_alias='sshpass -f <(printf "%s\n" "our_password") ssh user@hostname'
4. compile your `.bash_aliases` file: `source .bash_aliases``
@mikedamoiseau
mikedamoiseau / drupal-create-new-paragraph.md
Last active August 26, 2020 04:24
Drupal 8 - Steps to create a new paragraph
  1. Create paragraphs
  2. People > Permissions
  • View content: "Gast" and "Angemeldete Benutzer" ("Guests" and "Authenticated users")
  1. Create Image style
  • S, M, L, L 2x Image Style Name S / Image Style Name M / Image Style Name L / Image Style Name L 2x
  1. Create Responsive Image Style
  • apply the breakpoints
  1. Add fields to the parent paragraph
  2. Manage form display
drush ev "drupal_set_installed_schema_version('aaa_sigel', 8109);"
@mikedamoiseau
mikedamoiseau / d8-backup-db.sh
Created August 28, 2020 08:46
Drupal - Backup DB using Drush
#!/bin/bash
# staging or production
DB_ENV="staging"
##### DO NOT EDIT FROM HERE #####
# Find the container
CONTAINER="$(docker ps | grep c-${DB_ENV} | awk '{print $1}')"
@mikedamoiseau
mikedamoiseau / ftp-download-upload.md
Created September 16, 2020 09:26
FTP: Download and upload through command line

Download

wget -m --user="user@login" --password="Pa$$wo|^D" ftp://server.com/

Upload

  1. Download NcFTP
  2. ~/ncftp-3.2.6/bin/ncftpput -R -v -u "USERNAME" HOST REMOTE_FOLDER LOCAL_FOLDER
@mikedamoiseau
mikedamoiseau / gist:1d05957077b3c72ab7fd5ac06330e8a5
Created September 26, 2020 07:47
Format drive partition to exFAT on Ubuntu
Need to install these tools:
`sudo apt install exfat-utils exfat-fuse`
Use software `Disks`
@mikedamoiseau
mikedamoiseau / .gitconfig
Created June 17, 2021 03:21 — forked from robmiller/.gitconfig
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@mikedamoiseau
mikedamoiseau / cakephp-last-executed-query
Created July 9, 2014 08:48
CakePHP - Display last executed SQL query
$dbo = $this->Job->getDatasource();
$logs = $dbo->getLog();
$lastLog = end($logs['log']);
debug( $lastLog['query'] );
@mikedamoiseau
mikedamoiseau / Leaflet with Google, Bing and Openstreet Maps
Last active December 10, 2021 06:26
Leaflet with Google, Bing and Openstreet Maps
**Create a Bing API key**
https://www.bingmapsportal.com/application/create/1354301
**Download the plugins**
https://github.com/shramov/leaflet-plugins
```html
<!DOCTYPE html>
<html>
<head>