Skip to content

Instantly share code, notes, and snippets.

@crohr
crohr / install-openproject-plugins.md
Last active June 8, 2018 07:03
Install openproject plugins using the debian package

Let's say you wanted to install this plugin: https://github.com/finnlabs/openproject-meeting. Here is how you would do it with the openproject version packaged at https://pkgr.io/apps/tessi/openproject:

cat >> /opt/openproject/Gemfile.plugins <<EOF
gem "openproject-plugins", :git => "https://github.com/opf/openproject-plugins.git", :branch => "stable"
gem "openproject-meeting", :git => "https://github.com/finnlabs/openproject-meeting.git", :branch => "stable"
EOF
@codyjroberts
codyjroberts / seoul256.zsh-theme
Created August 17, 2016 17:37
nicolauj and seoul256 inspired zsh-theme
#!/usr/bin/env zsh
# ------------------------------------------------------------------------------
# Prompt for the Zsh shell:
# * One line.
# * VCS info on the right prompt.
# * Only shows the path on the left prompt by default.
# * Crops the path to a defined length and only shows the path relative to
# the current VCS repository root.
# * Wears a different color wether the last command succeeded/failed.
# * Shows user@hostname if connected through SSH.
# Seoul oh-my-zsh theme
# Theme with username, hostname, relative path and git branch
# Inspired by Maran theme and Seoul256 color scheme
PROMPT='%F{173}%n%{$reset_color%}%F{252}@%{$reset_color%}%F{179}%M%{$reset_color%}%F{252}:%{$reset_color%}%F{116}%~%{$reset_color%}$(git_prompt_info) %F{252}%(!.#.$)%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX="%F{252}:%{$reset_color%}%F{108}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="*"
ZSH_THEME_GIT_PROMPT_CLEAN=""
@jj1bdx
jj1bdx / update-python-homebrew.md
Last active February 23, 2019 16:23
Updating python, pip, setuptools/easy_install on OS X with HomeBrew

Updating Python on OS X with HomeBrew

Updating Python library with HomeBrew could be a painful experience. Upgrading setuptools and pip may cause version disruption and will render pip and easy_install useless.

Here's a list of commands for the install process, FYI.

# disable virtualenv before doing this
@sgk
sgk / trac2down.py
Created October 14, 2011 09:35
Trac Wiki to Markdown converter
#!/usr/bin/python
# vim:set fileencoding=utf-8 sw=2 ai:
import sqlite3
import datetime
import re
SQL = '''
select
name, version, time, author, text
@ast
ast / main.go
Last active December 30, 2020 20:31
Using epoll with go. Packages like fsnotify does not work with sysfs. Then you need epoll, poll or select.
package main
import (
"golang.org/x/sys/unix"
"log"
"os"
)
func main() {
file, err := os.Open("/sys/class/somefile")
@hagmonk
hagmonk / install.md
Created July 6, 2019 23:58
K3OS on Raspberry Pi

Imaging

Assuming macOS and an SD card presented as /dev/rdisk3:

For ARMv7 (Pi 2):

diskutil unmountDisk disk3
xzcat ubuntu-18.04.2-preinstalled-server-armhf+raspi2.img.xz | sudo dd of=/dev/rdisk3 bs=32m
@Ryanb58
Ryanb58 / ftps_list_dir.py
Last active February 16, 2023 11:03
Quick script to connect to a FTPS server via python.
# WOrks in python 2.7 not sure if it works in python 3.
# Just straight up connect by any means possible.
from ftplib import FTP_TLS
def connect():
ftp = FTP_TLS()
ftp.debugging = 2
ftp.connect('localhost', 2121)
ftp.login('developer', 'password')
@batok
batok / paramiko_example.py
Created April 10, 2012 16:11
Paramiko example using private key
import paramiko
k = paramiko.RSAKey.from_private_key_file("/Users/whatever/Downloads/mykey.pem")
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
print "connecting"
c.connect( hostname = "www.acme.com", username = "ubuntu", pkey = k )
print "connected"
commands = [ "/home/ubuntu/firstscript.sh", "/home/ubuntu/secondscript.sh" ]
for command in commands:
print "Executing {}".format( command )
@thomasaarholt
thomasaarholt / languages.toml
Created August 4, 2023 18:51
Helix languages.toml setup for Python with pyright, ruff and black
[[language]]
name = "python"
scope = "source.python"
injection-regex = "python"
file-types = ["py","pyi","py3","pyw",".pythonstartup",".pythonrc"]
shebangs = ["python"]
roots = [".", "pyproject.toml", "pyrightconfig.json"]
comment-token = "#"
language-servers = ["pyright", "ruff"]
indent = { tab-width = 4, unit = " " }