Skip to content

Instantly share code, notes, and snippets.

View bric3's full-sized avatar
💭
🤨

Brice Dutheil bric3

💭
🤨
View GitHub Profile
@bric3
bric3 / synology-transmission-note.md
Last active April 27, 2025 10:02 — forked from samgooi4189/synology-transmission-note.txt
Synology transmission change username and password

The default credential is admin:admin.

  1. SSH into your synology
  2. Stop transmission : sudo synopkg start transmission
  3. Edit /var/packages/transmission/var/settings.json to change the username and password, make sure authentication is required, pssibly requires sudo.
{
    "rpc-authentication-required": true,
    "rpc-username": "...",
@bric3
bric3 / .finicky.js
Last active April 9, 2025 16:14
Public finicky v3 config template
// Use https://finicky-kickstart.now.sh to generate basic configuration
// Learn more about configuration options: https://github.com/johnste/finicky/wiki/Configuration
// Get bundle id with: mdls /Applications/Firefox.app | grep kMDItemCF
const browsers = {
personal: {
name: 'org.mozilla.firefox', // or Firefox
openInBackground: false,
},
@bric3
bric3 / install_jdk5_post_lion.sh
Last active March 16, 2025 21:11
Automate the install of JDK 5 on Lion, Mountain Lion, Mavericks
# _______ _ _ _ _ _
# |__ __| | (_) (_) | | | |
# | | | |__ _ ___ ___ ___ _ __ _ _ __ | |_ _ __ ___ _____ _____ __| |
# | | | '_ \| / __| / __|/ __| '__| | '_ \| __| | '_ ` _ \ / _ \ \ / / _ \/ _` |
# | | | | | | \__ \ \__ \ (__| | | | |_) | |_ | | | | | | (_) \ V / __/ (_| |
# |_| |_| |_|_|___/ |___/\___|_| |_| .__/ \__| |_| |_| |_|\___/ \_/ \___|\__,_|
# | |
# |_|
#
# New home : https://github.com/bric3/osx-jdk5-installer
@bric3
bric3 / svg-patch.gradle.kts
Last active October 21, 2024 13:07
SVG Patcher for gradle using Stax Approach (does not maintain order)
import java.io.StringWriter
import javax.xml.namespace.QName
import javax.xml.stream.XMLEventFactory
import javax.xml.stream.XMLInputFactory
import javax.xml.stream.XMLOutputFactory
import javax.xml.stream.events.Attribute
import javax.xml.stream.events.StartElement
tasks.register<GenerateDarkIconVariant>("patchSVG")
abstract class GenerateDarkIconVariant @Inject constructor(project: Project) : DefaultTask() {
# Call `setup_ssh_socket` to setup the control socket (function will return once
# the socket is ready to go), and `ssh_target` will connect using the control socket.
# Assumes TARGET_HOST variable is set.
# The connection is automatically closed when the script exists.
# TARGET_HOST="wolever.net"
# setup_ssh_control_socket
# ssh_target "hostname"
debug() {
echo "DEBUG: $*"
@bric3
bric3 / SSLPoke.java
Created February 10, 2020 07:17
The famous SSLPoke from Atlassian : establish a TLS connection but support http proxy and updated to Java 11
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.Socket;
@bric3
bric3 / CodeBlockNodeRenderer.kt
Last active May 6, 2024 14:01
HTML `JEditor` pane for IntelliJ (and markdown code snippet with highlighting), for pre `JBHtmlPane`
import com.intellij.lang.Language
import com.intellij.lang.documentation.DocumentationSettings
import com.intellij.lang.documentation.DocumentationSettings.InlineCodeHighlightingMode.NO_HIGHLIGHTING
import com.intellij.lang.documentation.DocumentationSettings.InlineCodeHighlightingMode.SEMANTIC_HIGHLIGHTING
import com.intellij.openapi.editor.HighlighterColors
import com.intellij.openapi.editor.colors.EditorColorsManager
import com.intellij.openapi.editor.richcopy.HtmlSyntaxInfoUtil
import com.intellij.openapi.fileTypes.PlainTextLanguage
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.text.StringUtil
@bric3
bric3 / Stonks.java
Last active December 19, 2023 12:59
/*
* Stonks.java
*
* Copyright (c) 2021,today - Brice Dutheil <brice.dutheil@gmail.com>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
///usr/bin/env jbang "$0" ; exit $?
@bric3
bric3 / GraalJsDemo.java
Last active January 7, 2023 14:27
Simple snippet showcasing hello-word scenario to run the Graal JS Engine.
/*
* GraalJsDemo.java
*
* Copyright (c) 2021,today - Brice Dutheil <brice.dutheil@gmail.com>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
///usr/bin/env jbang "$0" ; exit $?
@bric3
bric3 / checknetwork.init.gradle.kts
Last active December 12, 2022 10:34
Makes gradle go automatically go offline
/**
* Makes gradle go automatically offline.
*
* Store in $HOME/.gradle/init.d/checknetwork.init.gradle.kts
*/
import java.io.IOException
import java.net.InetSocketAddress
import java.net.Socket
import java.net.SocketException
import java.net.UnknownHostException