Skip to content

Instantly share code, notes, and snippets.

@f1yn
f1yn / enable_gdm_synergy_not_a_script.md
Created November 14, 2022 05:36
Enable Synergy (correctly) at login on any Linux using GDM3

These commands come AS IS, WITH NO WARRANTY. I AM NOT RESPONSIBLE IF YOU BORK YOUR SYSTEM

Synergy on Linux - It's great when it works, but it's also a pain because most guides are intended for Ubuntu 18, which is absolutely useless now. Here is how I was able to setup Synergy at login on a Pop_OS 22.04, but should ALSO work for ANY distribution using GDM3 as it's login manager (i.e Fedora and/or Ubuntu).

Step 1

Install synergy. Make sure that synergyc is installed first (included in deb or rpm)

Step 2

@cosmincatalin
cosmincatalin / install-jupyter.sh
Last active October 23, 2025 02:03
AWS EMR bootstraps to install Jupyter (R, SparkR, Python 2, Python 3, PySpark)
#!/bin/bash
MINICONDA_VERSION="4.3.21"
PANDAS_VERSION="0.20.3"
SCIKIT_VERSION="0.19.0"
while [[ $# > 1 ]]; do
key="$1"
case $key in
@anschaef
anschaef / bootstrap-4-sass-mixins-cheat-sheet.scss
Last active August 11, 2025 18:58
Bootstrap 4 Sass Mixins [Cheat sheet with examples]
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// Updated to Bootstrap v4.5.x
// @author https://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/master/scss/mixins
/* -------------------------------------------------------------------------- */
/*
// ########################################################################## */
// New cheat sheet for Bootstrap 5:
@omnisis
omnisis / nexus-uploader.py
Last active October 4, 2023 08:26
Uploads a local M2 repo to a remote Nexus Server
#!/usr/bin/env python
""""
nexus-uploader.py
Allows mirroring local M2 repositories to a remote Nexus server with a single command.
Supports:
- uploading of common classifiers (sources, javadocs) if available
- using regex include pattern for artifactIds/groupIds
- recursively processing local repo, just point to the root
package com.logentries.mq;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.logentries.api.Batch;
@chrissimpkins
chrissimpkins / cythonrun.py
Created January 11, 2016 19:32 — forked from brentp/cythonrun.py
run a cython .pyx file
#!/usr/local/bin/python
"""
build and run a .pyx file with dependencies.
runs a main() function if it exists.
automatically detects 'cimport numpy'
and includes headers. other includes/libs specificed by command-line args.
%prog [options] source.pyx dep1.c dep2.c
@twolfson
twolfson / README.md
Last active February 12, 2025 16:48
Leverage Flask-SQLAlchemy with Celery

Last update: Feb 3, 2015

Flask-SQLAlchemy has some nice built-ins (e.g. accessing query directly on classes). To continue leveraging these nicities while still inside of a Celery worker, we need to make sure we setup/teardown in a similar fashion to Flask-SQLAlchemy does on Flask.

Setup

Flask-SQLAlchemy uses create_scoped_session at startup which avoids any setup on a per-request basis.

https://github.com/mitsuhiko/flask-sqlalchemy/blob/2.0/flask_sqlalchemy/__init__.py#L668

This means Celery can piggyback off of this initialization.

@wernight
wernight / inotifyexec.py
Last active December 17, 2024 19:33
inotifywait helper that executes a command on file change (for Linux, put it in ~/bin/)
#!/usr/bin/env python
"""Use inotify to watch a directory and execute a command on file change.
Watch for any file change below current directory (using inotify via pyinotify)
and execute the given command on file change.
Just using inotify-tools `while inotifywait -r -e close_write .; do something; done`
has many issues which are fixed by this tools:
* If your editor creates a backup before writing the file, it'll trigger multiple times.
* If your directory structure is deep, it'll have to reinitialize inotify after each change.
@dominiccooney
dominiccooney / find-svn-commit.sh
Created October 11, 2009 00:19
Find the git commit of an svn revision
#!/bin/bash
# Parses git log and finds the commit with the specified svn change
# number.
git log | awk "/^commit / {c=\$2} /git-svn-id:.*@$1 / {print c}"
# This is obsoleted by git svn find-rev rNNNN