Skip to content

Instantly share code, notes, and snippets.

View rasata's full-sized avatar
😉

Zo-Hasina Rasatavohary rasata

😉
  • Zonova
  • France
View GitHub Profile
@rasata
rasata / Caddyfile
Created February 2, 2020 20:24 — forked from abiosoft/Caddyfile
Caddy wordpress docker-compose
:80
root /usr/src/wordpress
gzip
fastcgi / wordpress:9000 php
rewrite {
if {path} not_match ^\/wp-admin
to {path} {path}/ /index.php?_url={uri}
}
log stdout
errors stderr
@rasata
rasata / import_vagrant_box_into_vbox.sh
Created November 21, 2019 03:27 — forked from elleryq/import_vagrant_box_into_vbox.sh
Import Vagrant box into VirtualBox
#!/bin/bash
BOX=$1
if [ -z $BOX ]; then
echo "Need argments."
exit -1
fi
if [ ! -e $BOX ]; then
To convert from GHO to VMDK
> ghost32 -clone,mode=restore,src=my.gho,dst=myimage.vmdk -batch -sure
To convert from VMDK to GHO spliiting into 100MB chunks
> ghost32 -clone,mode=create,src=my.vmdk,dst=myimage.gho -batch -sure -split=100
There are some more switch available:
+ vmdktype: Used for specifying the VMDK file type , which can be Sparse or Flat
+ vmdksplit: Used for splitting the VMDK image
+ vmdksize: Used in specifying the size of vmdk file
@rasata
rasata / installing-node-with-nvm.md
Created June 19, 2019 21:38 — forked from d2s/installing-node-with-nvm.md
Installing Node.js to Linux & macOS & WSL with nvm
@rasata
rasata / UnmanagedArrayConverter.cs
Created May 14, 2019 08:20 — forked from gregseth/UnmanagedArrayConverter.cs
Conversion of an unmanaged to a managed array of struct
/// <summary>
/// Méthode générique de conversion d'un pointeur sur une liste de
/// structures non managées, en un tableau managé de structures.
/// </summary>
/// <typeparam name="Struct">Le type de la structure</typeparam>
/// <param name="_P">Le pointeur vers le premier élément du tableau
/// non managé.</param>
/// <param name="_Size">La taille du tableau non managé.</param>
/// <returns>Le tableau managé contenant les structures.</returns>
Struct[] PtrToStructArray<Struct>(IntPtr _P, int _Size)
@rasata
rasata / Jenkinsfile.groovy
Created August 23, 2018 14:48 — forked from Faheetah/Jenkinsfile.groovy
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER'
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"'
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"'
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"'
echo 'Using three backslashes still results in preserving the single quotes'
@rasata
rasata / Dockerfile-es
Created August 14, 2018 10:15 — forked from wshayes/Dockerfile-es
Elasticsearch and Kibana using docker-compose (v3)
FROM docker.elastic.co/elasticsearch/elasticsearch:5.5.1
RUN \
mv /usr/share/elasticsearch/plugins/x-pack /usr/share/elasticsearch/plugins/.removing-x-pack && \
mv /usr/share/elasticsearch/plugins/.removing-x-pack /usr/share/elasticsearch/plugins/x-pack && \
/usr/share/elasticsearch/bin/elasticsearch-plugin remove x-pack
@rasata
rasata / angular-1-file-upload-example.html
Last active April 23, 2018 10:22 — forked from iffy/index.html
Angular 1 File Upload example
<!DOCTYPE html>
<html lang="en">
<body ng-app="myapp" ng-controller="UploadCtrl">
<input type="file" file-change="upload">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<script>
// the javascript
var app = angular.module('myapp', []);
@rasata
rasata / Docker Snippets
Created April 10, 2018 13:23 — forked from dchapkine/Docker Snippets
Docker Snippets
# Build
IMAGEID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1) && sudo docker build -t $IMAGEID .
# Run new container
CONTAINER_ID=$(sudo docker run -t -d -p 0.0.0.0:81:80 $IMAGEID)
# Login into running containe. REQUIRES DOCKER >= 1.3
sudo docker exec -it $CONTAINER_ID bash
# !!! DEPRECATED !!! Login into running container. REQUIRES DOCKER < 0.9