Skip to content

Instantly share code, notes, and snippets.

View jlandure's full-sized avatar
💭
👋

Julien Landuré jlandure

💭
👋
View GitHub Profile
@jlandure
jlandure / launch.sh
Last active February 12, 2020 12:24
hugo command
#!/bin/bash
#Fetch Nantes branch
env
echo $'#!/bin/bash\nif [ "$CI_BRANCH" = "nantes" ]\nthen\n echo "Not a PullRequest, checkout nantes branch"\n git fetch origin\n git checkout nantes\nfi\n' > git-command.sh
cat git-command.sh
chmod +x git-command.sh && ./git-command.sh
rm -Rf themes/devfest-theme-hugo
git clone https://github.com/GDG-Nantes/devfest-theme-hugo.git themes/devfest-theme-hugo
#Get Hugo
#curl -fsSL -o /tmp/hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v0.55.2/hugo_extended_0.55.2_Linux-64bit.tar.gz
@jlandure
jlandure / 2 UserDaoDatastore.java
Last active February 13, 2019 09:46
1 epsi-20181111
package com.zenika.zencontact.persistence.datastore;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.google.appengine.api.blobstore.*;
import com.google.appengine.api.datastore.*;
import com.zenika.zencontact.domain.User;
import com.zenika.zencontact.persistence.UserDao;
@jlandure
jlandure / 1 epsi-20181212 download zip
Last active February 10, 2021 09:13
Cours epsi-20181212
https://backoffice-dot-epsi-20181212-ju.appspot.com/tp1.zip
@jlandure
jlandure / Dockerfile
Created September 16, 2018 20:13
apk command
RUN apk add --no-cache git
RUN apk add --no-cache --virtual .build-deps \
g++ \
make \
python \
&& npm --quiet install --global node-sass \
&& apk del .build-deps \
&& rm -rf /tmp/*
&& rm -rf /var/lib/apt/lists/* \
@jlandure
jlandure / cmd.sh
Last active July 23, 2018 20:01
cloudshell commands
USER_EMAIL=$(gcloud auth list --limit=1 2>/dev/null | grep '@' | awk '{print $2}')
Authorization_Bearer=$(gcloud auth application-default print-access-token)
PLAINTEXT=$(cat $file | base64 -w0)
PROJECT=$(gcloud info --format='value(config.project)')
@jlandure
jlandure / cmd.sh
Created April 13, 2018 14:49
dns cmd
dig immutadot.zenika.com +nostats +nocomments +nocmd
@jlandure
jlandure / version.sh
Created February 9, 2018 16:05
Shell replacement
#!/bin/sh
#export DEVSHELL_PROJECT_ID="demoing"
DEVSHELL_PROJECT_ID=${DEVSHELL_PROJECT_ID:-'ices-demo'} # If variable not set, set it to default.
echo "begin"
echo $DEVSHELL_PROJECT_ID
export DEVSHELL_PROJECT_ID=$DEVSHELL_PROJECT_ID
echo "end"
env | grep DEVSHELL_PROJECT_ID
#export VERSION=$(cat package.json | grep version | cut -d'"' -f4)
@jlandure
jlandure / idea
Last active February 12, 2018 09:06
Gist for googlecloud.tips
1/ mobile app
https://play.google.com/store/apps/details?id=com.google.android.apps.cloudconsole
2/ not promoting by default
3/ alpine-appengine-java
https://github.com/Zenika/alpine-appengine-java
4/ Use @WebServlet to not use web.xml ?
5/ Get estimated dollar by request in the trace :)
6/ deploy with circleCI ? :)
@jlandure
jlandure / cmd.sh
Last active August 2, 2017 08:46
ssh-add keychain macos with passphrase
#generate your key
ssh-keygen
# add to the macos keychain
ssh-add -K ~/.ssh/[your-private-key]
#create a file to indicate to use the macos keychain '.ssh/config'
Host *
UseKeychain yes
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa
@jlandure
jlandure / git-cmd
Last active February 21, 2024 12:39
git global options + tips
IL that git push -u origin my-new-branch is no more needed with push.autoSetupRemote :
git config --global --add --bool push.autoSetupRemote true
git config --global --add --bool pull.rebase true
git config --global --add --bool rebase.autoStash true
git config --global --add --bool fetch.prune true
# git undo
git config --global alias.undo '!f() { \
git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; \
}; f' => http://megakemp.com/2016/08/25/git-undo/