Skip to content

Instantly share code, notes, and snippets.

View tchartron's full-sized avatar
☁️

Thomas Chartron tchartron

☁️
View GitHub Profile
@tchartron
tchartron / mraid.js
Created February 19, 2025 22:31 — forked from bensojona/mraid.js
/*
Do not modify this version of the file. It will be copied over when any of the project's targets are built.
If you wish to modify mraid.js, modify the version located at mopub-sdk-common/mraid/mraid.js.
*/
(function() {
var isIOS = (/iphone|ipad|ipod/i).test(window.navigator.userAgent.toLowerCase());
if (isIOS) {
console = {};
console.log = function(log) {
var iframe = document.createElement('iframe');
@tchartron
tchartron / docker-one-liners.sh
Last active November 11, 2022 18:34
Docker command one liner commands
# Laravel install
docker run --rm -v $(pwd):/app -w /app composer:latest composer create-project laravel/laravel laravel
docker run --rm -it -v $(pwd):/app composer:latest composer create-project laravel/laravel web
# Node
docker run -it --rm -v $(pwd):/app -w /app node:latest npm -v
# Composer
docker run -it --rm -v $(pwd):/app composer:latest bash
@tchartron
tchartron / composer-docker-laravel
Last active February 2, 2024 10:38
Create a new laravel app using composer in a docker container
docker run --rm --interactive --tty --volume $PWD:/app composer create-project laravel/laravel project_name
@tchartron
tchartron / fresh_pve_vm.sh
Created June 16, 2021 08:02
Setup a docker ready Proxmox Debian 10 VM
#In PVE console
adduser johndoe
ip a #to check ip
apt update
apt install sudo # needed to use groupadd
apt install vim
apt install qemu-guest-agent
#From Iterm2
ssh [email protected]
#Install docker : https://docs.docker.com/engine/install/debian/
@tchartron
tchartron / fresh_laravel.sh
Created June 16, 2021 07:58
Setup a fresh laravel installation during development
#!/usr/bin/env bash
echo "Remove storage/app/public/img directory"
rm -rf storage/app/public/img
echo "Remove vendor directory"
rm -rf vendor
echo "Remove node_modules directory"
rm -rf node_modules
echo "Installing composer dependencies"
composer install
echo "Installing npm dependencies"
@tchartron
tchartron / openvpn-local-dns.conf
Created May 14, 2021 09:14
Push local dns server to use when connected to openvpn
route-nopull
route 192.168.0.200 255.255.255.255
route X.X.X.X 255.255.255.0
script-security 2
dhcp-option DNS 192.168.0.200
dhcp-option DOMAIN local.intra
@tchartron
tchartron / mysql-docker.sh
Created March 4, 2021 16:22 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@tchartron
tchartron / gohugo-githubpages-deploy.sh
Last active December 4, 2020 20:51
Gohugo deploy to github pages
#!/bin/sh
# If a command fails then the deploy stops
set -e
if [ -d "public" ]
then
printf "\033[0;32mRemoving public folder except .git to keep the submodule...\033[0m\n"
cd public
find . -not -name '.git' -not -name 'README.md' -delete
@tchartron
tchartron / docker-pi
Last active July 4, 2020 09:55
Install docker and docker-compose on raspberry pi
#Docker
curl -sSL https://get.docker.com | sh
sudo usermod -aG docker pi
sudo su - pi
docker version
docker run hello-world
@tchartron
tchartron / pi-ssh-wifi-raspbian
Last active July 4, 2020 12:35
Headless raspberry pi ssh + wifi from MacOS
#!/usr/bin/env bash
touch /Volumes/boot/ssh
touch /Volumes/boot/wpa_supplicant.conf
echo 'country=FR
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1