Skip to content

Instantly share code, notes, and snippets.

View ValCapri's full-sized avatar

Schinckus Lionel ValCapri

View GitHub Profile
@rock3r
rock3r / README.md
Last active January 27, 2024 14:51
A simple bash script to enable demo mode on a Marshmallow+ device via ADB (based on http://bit.ly/295BHLx)

Usage

$ demo on|off [hhmm]

Enable or disable the demo mode on a connected Android device or emulator. You can also pass in a custom value for the system clock in the HHMM format (only used when you use the on command).

⚠️ This script only works on *nix systems and has only been tested on macOS with Bash (but should be portable).

@maxvt
maxvt / infra-secret-management-overview.md
Last active February 3, 2025 06:11
Infrastructure Secret Management Software Overview

Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.

This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.

There is a companion feature matrix of various tools. Comments are welcome in the same manner.

#!/bin/bash
set -e
JAVA_HOME=${1-text}
[ $# -eq 0 ] && { echo "Usage: sudo $0 \$(/usr/libexec/java_home -v '1.8*')" ; exit 1; }
KEYSTORE=$JAVA_HOME/jre/lib/security/cacerts
wget https://letsencrypt.org/certs/letsencryptauthorityx1.der
wget https://letsencrypt.org/certs/letsencryptauthorityx2.der
@antoniomaria
antoniomaria / build.gradle
Created April 12, 2016 06:46
Gradle Karaf assembly
apply plugin: 'base'
configurations {
runtime
paxlogback
}
dependencies {
runtime "org.apache.karaf:apache-karaf:$karafVersion@zip"
paxlogback "ch.qos.logback:logback-core:$logbackVersion@jar"
@joepie91
joepie91 / .md
Last active April 17, 2025 04:50
Running a Node.js application using nvm as a systemd service

Read this first!

Hi there! Since this post was originally written, nvm has gained some new tools, and some people have suggested alternative (and potentially better) approaches for modern systems. Make sure to have a look at the comments to this article, before following this guide!


The original article

Trickier than it seems.

@sketchytech
sketchytech / ButtonTooltip.swift
Last active March 1, 2023 14:18
Swift: Popover tooltip from button in iOS
import UIKit
class ViewController: UIViewController {
var label:ToolTip!
var labelTransform:CGAffineTransform!
let buttonHeight:CGFloat = 100
let buttonWidth:CGFloat = 200
override func viewDidLoad() {
import java.io.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
public class UnzipUtility
{
/**
* Size of the buffer to read/write data
*/
private static final int BUFFER_SIZE = 4096;
#!/bin/bash -xv
### Country list
# CHANGE WITH YOUR COUNTRIES
COUNTRIES="europe/france/guadeloupe europe/france/guyane europe/france/mayotte europe/france/martinique europe/france/reunion europe/france"
# SMALL SUBSET FOR TESTING:
COUNTRIES="europe/france/guyane europe/france/mayotte"
NOMINATIM="/var/www/Nominatim"
cd $NOMINATIM/data
@Ashton-W
Ashton-W / Breakpoints_v2.xcbkptlist
Last active January 25, 2023 09:28
My User Breakpoints_v2.xcbkptlist
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "2"
version = "2.0">
<Breakpoints>
<!-- All Exceptions -->
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
@drmalex07
drmalex07 / howto-syslog-from-uwsgi.md
Last active February 9, 2018 12:53
Enable syslog local logging for an application running under uWSGI. #wsgi #uwsgi #logging #syslog #rsyslog

The following recipe is tested on a debian 7.x system.

Start the uWSGI server to serve the application. The following example assumes a paste-deployed helloworld app. We choose to log under local0 syslog facility with a name of helloworld

uwsgi --ini-paste-logged $(pwd)/development.ini --pidfile /tmp/helloworld.pid --logger syslog:helloworld,local0

or, as a daemon

 uwsgi --ini-paste-logged $(pwd)/development.ini --pidfile /tmp/helloworld.pid --daemonize $(pwd)/development.ini --logger syslog:helloworld,local0