Skip to content

Instantly share code, notes, and snippets.

@netravnen
netravnen / rslsync-ufw.sh
Last active January 29, 2024 11:59 — forked from auipga/rslsync-ufw.sh
Help configuring ufw for Resilio Sync (rslsync)
#!/bin/bash
# Author: https://gist.github.com/auipga/
# Based on:
# Sync (outdated?): https://kb-archive.getsync.com/kbs/1.3.5/kb/hc/en-us/articles/210153106-Ports-and-protocols-used-by-Resilio-Connect.html
# Resilio Connect: https://help.getsync.com/hc/en-us/articles/204754759-What-ports-and-protocols-are-used-by-Sync-
# todo: read sync.conf from resilio server, parse json, fill IPs dynamically
# todo: delete duplicate rules as 'host' returns multiple IPs for resilios domains
@yann-eugone
yann-eugone / EntityTranslatorStrategy.php
Last active August 13, 2018 07:49
Automatically Register Sonata Admin services
<?php
namespace App\Admin\Translator;
use Sonata\AdminBundle\Translator\LabelTranslatorStrategyInterface;
class EntityTranslatorStrategy implements LabelTranslatorStrategyInterface
{
/**
* @var string
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active April 23, 2024 15:35
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@auipga
auipga / register-btsync-proto-gnome-firefox.sh
Last active November 17, 2022 22:23
register btsync protocol for firefox on gnome (does also work with rslsync)
#!/bin/bash
# see http://kb.mozillazine.org/Register_protocol#Linux
gconftool-2 -s /desktop/gnome/url-handlers/btsync/command "`which rslsync` %s" --type String
gconftool-2 -s /desktop/gnome/url-handlers/btsync/enabled --type Boolean true
# get default profile path
ff_profile=$(cat ~/.mozilla/firefox/profiles.ini | grep Path | sed s/^Path=//)
ff_profile_dir="~/.mozilla/firefox/$ff_profile"
@fprochazka
fprochazka / composer.php.ini
Last active June 14, 2022 15:09
Composer with different ini or with different PHP
[php]
memory_limit = -1
max_execution_time = 0
date.timezone = "Europe/Prague"
realpath_cache_size = "4096K"
[opcache]
opcache.enable = 1
opcache.enable_cli = 1
opcache.memory_consumption = 256
@mubeeniqbal
mubeeniqbal / snp
Last active June 8, 2021 14:43 — forked from cmlsharp/snp
Runs a command wrapped with snapper pre-post snapshots for btrfs subvolumes. File path: /usr/local/bin
#!/usr/bin/env bash
#
# Runs a command wrapped with snapper pre-post snapshots for btrfs subvolumes.
# Usage: snp [-c config1,config2,...] <command>
# Constants
readonly LOG_PATH='/var/local/log/snp'
readonly DATE="$(date +'%Y-%m-%d-%H%M%S')"
readonly LOG_FILE="${LOG_PATH}/snp-${DATE}.log"
@beregond
beregond / gist:4373142
Last active February 7, 2022 14:41
Allows to abandon necessity to define all setters and getters in Doctrine's entities (works perfectly with Symfony + Doctrine + Twig).
<?php
namespace Vendor\TestBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* Gneral class for all entities.
*/
@andsens
andsens / bootstrap_homeshick.sh
Last active December 27, 2023 12:47
Script that can set up an entire user account with homeshick automatically
#!/bin/bash -ex
# Paste this into ssh
# curl -sL https://gist.github.com/andsens/2913223/raw/bootstrap_homeshick.sh | tar -xzO | /bin/bash -ex
# When forking, you can get the URL from the raw (<>) button.
### Set some command variables depending on whether we are root or not ###
# This assumes you use a debian derivate, replace with yum, pacman etc.
aptget='sudo apt-get'
chsh='sudo chsh'