Skip to content

Instantly share code, notes, and snippets.

View 7rin0's full-sized avatar

SEVERINO, Luis 7rin0

  • Lyon, France
View GitHub Profile
@7rin0
7rin0 / sync-vagrant-vbox.md
Last active April 25, 2016 19:56
Sometimes sync gets broken or even doesn't work. This script or procedural commands are intended to solve this issue

Its assumed that:

  • vagrant up is done
  • vagrant provision too
  • shared folders/sync still not work

First and foremost:

  • get your Virtualbox version: vboxmanage --version | cut -d 'r' -f1
  • keep the returned version and for this example lets say: VBOXVERSION = 4.3.36

Connect to your machine:

// Start application from japplascript.init()
var global_one,
global_two,
global_three,
japplascript = {
function_one: function () {
console.log('inside function one');
console.log(global_one);
@7rin0
7rin0 / development.services.yml
Last active September 26, 2016 08:19
Drupal 8 - Dev environment
# Local development services.
# /drupal8/sites/development.services.yml
services:
cache.backend.null:
class: Drupal\Core\Cache\NullBackendFactory
parameters:
twig.config:
debug: true
auto_reload: true
cache: false
@7rin0
7rin0 / chrome_php_logger.md
Last active October 16, 2016 13:31
Debug PHP using Chrome Console
@7rin0
7rin0 / repair_ubuntu_debian_grub.md
Last active October 16, 2016 13:51
Repair Debian Ubuntu Grub
@7rin0
7rin0 / nowakeup
Created November 3, 2016 03:40
ACPI - Wake up with Power button only (executed by root)
#!/bin/bash
echo 'UHC1' > /proc/acpi/wakeup
echo 'UHC2' > /proc/acpi/wakeup
echo 'UHC4' > /proc/acpi/wakeup
echo 'UHC6' > /proc/acpi/wakeup
echo 'USB5' > /proc/acpi/wakeup
echo 'USB3' > /proc/acpi/wakeup
echo 'USB5' > /proc/acpi/wakeup
@7rin0
7rin0 / fetch_each_origin.sh
Created February 20, 2017 21:40
Bypass some limitations on getting origin HEAD by parsing each branch individually.
#!/bin/bash
# Bypass some limitations on getting origin HEAD
# by parsing each branch individually.
# Get all origin branchs
ORIGINS=$(git ls-remote --heads origin | tr '\/' ' ' | tr -s ' ' | cut -d' ' -f3)
for branch in $ORIGINS
@7rin0
7rin0 / jenkins-cli-to-docker-jenkins-install.sh
Last active March 8, 2017 00:43
From Jenkins CLI Plugin export to Docker Jenkins plugin-install.sh
#!/bin/bash
# Not recommended way.
# java -jar jenkins-cli.jar -s http://localhost:8080/ list-plugins | sed 's/\s\s+*/#/g' | tr -s '#' | sed 's/#.*#/:/g' | tr -d ' ' > plugins.txt
# cat plugins.list |tr -s ' ' | sed 's/\s.*\s/:/g' | sed 's/:[^0-9].*//g'
# Export to expected format by install-plugins.sh
java -jar jenkins-cli.jar -s http://localhost:8080/ list-plugins | tr -s ' ' | sed 's/\s.*\s/:/g' | sed 's/:[^0-9].*//g' > plugins.txt
# Install from default Jenkins cli export
@7rin0
7rin0 / git_dos2unix_auto.md
Last active March 10, 2017 11:01
Git filemode, autocrl, dos2unix

Git false filemode checking

git config core.filemode false

Git auto crlf file line-ending conversion

git config --global core.autocrlf true

Git: no ssl verification

git config http.sslVerify "false"

dos2unix

apt-get install dos2unix -y yum install dos2unix -y

@7rin0
7rin0 / dir_loop_cli.sh
Created March 10, 2017 19:45
Dir crawler loop
#/bin/bash
# Usually used at cli as inline-command.
for abc in $(dir); do touch $abc/README.md; done