Skip to content

Instantly share code, notes, and snippets.

View hakuno's full-sized avatar

Seiji 誠 次 hakuno

  • Brazil
  • 10:29 (UTC -03:00)
View GitHub Profile
@raj-saxena
raj-saxena / gcp_compute_mount_persistent_disk.sh
Last active August 30, 2023 23:57
Use the following script to mount a persistent storage during startup. This is helpful when you provision the compute instance as well as the persistent disk using some automation tool like Terraform. StackOverFlow question - https://stackoverflow.com/questions/53162620/automate-gcp-persistent-disk-initialization
#!/bin/bash
set -uxo pipefail
# DISK_NAME = Name of the disk in terraform
# DEVICE_NAME = When $DISK_NAME is mounted in the compute instance at `/dev/`
MOUNT_DIR=/mnt/disks/persistent_storage
# Check if entry exists in fstab
grep -q "$MOUNT_DIR" /etc/fstab
@ernestkamara
ernestkamara / AdbCommands
Created June 26, 2018 08:42 — forked from Pulimet/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@eddy8
eddy8 / MyQueueException.php
Last active June 15, 2021 01:11
use laravel queue standalone v5.3
<?php
/**
* 异常处理类
*/
use \Illuminate\Contracts\Debug\ExceptionHandler;
class MyQueueException implements ExceptionHandler
{
/**
@tristanlins
tristanlins / iconv.docker
Created October 10, 2015 15:41
Docker PHP extension recipes
FROM php:5.6-cli
RUN apt-get update \
&& apt-get install -y \
libfreetype6-dev \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install iconv \
&& apt-get remove -y \
libfreetype6-dev \
&& apt-get install -y \
@alexpchin
alexpchin / Add_Existing_Project_To_Git.md
Created June 1, 2014 20:14
Add Existing Project To Git Repo

#Adding an existing project to GitHub using the command line

Simple steps to add existing project to Github.

1. Create a new repository on GitHub.

In Terminal, change the current working directory to your local project.

##2. Initialize the local directory as a Git repository.

git init
@pkuczynski
pkuczynski / parse_yaml.sh
Last active April 9, 2024 18:36
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}