Skip to content

Instantly share code, notes, and snippets.

View gmarziou's full-sized avatar

Gaël Marziou gmarziou

  • Grenoble, France
  • 09:10 (UTC +01:00)
View GitHub Profile
# syntax=docker/dockerfile:1.7-labs
ARG RUBY_VERSION
ARG DISTRO_NAME=bullseye
FROM ruby:$RUBY_VERSION-slim-$DISTRO_NAME AS base
SHELL ["/bin/bash", "-c"]
RUN echo "IRB.conf[:HISTORY_FILE] = ENV['IRB_HISTFILE']" >> ~/.irbrc
/* So how does this work?
I'm using ANSI escape sequences to control the behavior of the terminal while
cat is outputting the text. I deliberately place these control sequences inside
comments so the C++ compiler doesn't try to treat them as code.*/
//
/*The commands in the fake code comment move the cursor to the left edge and
clear out the line, allowing the fake code to take the place of the real code.
And this explanation uses similar commands to wipe itself out too. */
//
#include <cstdio>
package com.example.cacheabletest;
import com.hazelcast.config.Config;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.IMap;
import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
@filipenf
filipenf / convert-and-test.sh
Last active March 28, 2023 20:39
Script to convert an ansible vault into a yaml file with encrypted strings
#!/bin/bash
#Vault password is 1
echo "Converting vault to yaml format:"
ansible-vault decrypt --output - vault | python ./convert_vault.py > new-vault.yml
echo "Decrypting a variable from the converted vault"
ansible localhost -i localhost, -e @new-vault.yml -m debug -a 'var=secret' --ask-vault-pas
@anvk
anvk / psql_useful_stat_queries.sql
Last active December 21, 2025 10:46
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@alirobe
alirobe / reclaimWindows10.ps1
Last active December 30, 2025 15:48
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
### OR take a look at
### https://github.com/HotCakeX/Harden-Windows-Security
@ochinchina
ochinchina / NettyConnection.java
Last active October 14, 2025 09:50
netty client reconnect if the connection is lost or the server is not started
package com.nokia.nls.nmif;
import io.netty.bootstrap.Bootstrap;
import io.netty.buffer.ByteBuf;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
@jdnichollsc
jdnichollsc / app.js
Last active November 16, 2017 13:12
Service with Angular.js in Ionic Framework to get Products from Web Service or Local Storage using Promises and ngCordova
var app = angular.module('demo', ['ionic', 'ngCordova', 'demo.controllers', 'demo.services']);
var controllers = angular.module('demo.controllers', []);
var services = angular.module('demo.services', []);
@metmajer
metmajer / README.md
Created February 26, 2015 15:10
Ansible Logging To Elasticsearch

Ansible Logging To Elasticsearch

Turns Ansible log outputs into plain JSON strings and sends them to an Elasticsearch cluster.

Place the script in your playbook's plugins/callbacks/ directory.

@davisford
davisford / .bowerrc
Last active November 11, 2020 07:09
Updated build system for Ionic Framework
{
"directory": "bower_components"
}