Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# Resize and send Image via Thunderbird Nautilus Script v1.0
#
# A Gnome 2 Nautilus script for resizing images from the context menu
# Written by Meinhard Benn (http://benn.org/)
# Licensed under the terms of the GNU GPLv3
###
# Configuration

Install MSYS2: http://www.msys2.org/

upgrade

pacman -Syu

You might need to run it again (it tells you to)

pacman -Su
@carlos22
carlos22 / clip.sh
Last active October 11, 2018 13:11
#!/usr/bin/env bash
#OUT="$HOME/clip_$(date +%Y-%m-%d_%H-%M-%S).png"
OUT=$(mktemp -t "clip-XXXXXX.png")
xclip -selection clipboard -t image/png -o > $OUT
if [ $? -eq 0 ]; then
echo "clipboard saved to: $OUT"
nautilus $OUT
else
rm $OUT
@carlos22
carlos22 / install-syncthing-smartos.md
Last active November 10, 2018 16:38
install syncthing on smartos
pkgin update
pkgin in syncthing
groupadd users
useradd -d /srv/syncthing -c "syncthing user" -s /usr/bin/false -g users synctg
mkdir -p /srv/syncthing
chown synctg:users /srv/syncthing
svccfg import syncthing.xml
svcadm enable syncthing
@carlos22
carlos22 / SmartOSVagrantDeployZone.md
Created March 10, 2018 17:32
SmartOS Vagrant Deploy Zone

Build zone with Vagrant

Requirements

  • Vagrant
  • VirtualBox (might work with vmware)
  • node.js/npm
  • sharutils (for dz; installed on most systems)

archlinux quick install:

@carlos22
carlos22 / gogs_migrate.sh
Created February 16, 2018 13:14 — forked from senz/gogs_migrate.sh
gogs repo migration script
#!/usr/bin/env bash
## Usage:
## ./migrate.sh $clone_url $project_name $owner_uid
## Migrate a repository to gogs into the user namespace of the token-user
## ./migrate.sh git@mygitlab.com:group/repo.git repo 1
## uid can be a group uid
## NB: for local migration, if your gogs instance is inside docker or vm, you must provide path local relative to container's fs
echo $1;
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib
includedir=${prefix}/include
Name: fuse
Description: Filesystem in Userspace
Version: 2.9.7
Libs: -L${libdir} -lfuse -pthread
Libs.private: -ldl
@carlos22
carlos22 / fix-qtcreator-doc-style.sh
Created July 19, 2017 11:48
this forces the usage of offline-simple.css instead of the offline.css (which is loaded via javascript in some cases, e.g. archlinux build of qtcreator)
#!/bin/bash
# this forces the usage of offline-simple.css instead of the offline.css (which is loaded via javascript in some cases, e.g. archlinux build of qtcreator)
sqlite3 /usr/share/doc/qt/qtcore.qch "Select writefile('/tmp/offline-simple.css', fd.Data) FROM FileNameTable fn, FileDataTable fd WHERE fn.fileId=fd.id AND fn.Name='style/offline-simple.css';"
sudo find /usr/share/doc/qt/ -name "*.qch" -exec sqlite3 '{}' "UPDATE FileDataTable SET Data = readfile('/tmp/offline-simple.css') WHERE id IN (SELECT FileId FROM FileNameTable WHERE Name='style/offline.css');" \;
#!/bin/bash
# https://github.com/dilshod/xlsx2csv
sudo pip install xlsx2csv
# config filter
echo -e '\n[diff "xlsx"]\n\ttextconv=xlsx2csv --all -d tab' >> ~/.gitconfig
# apply filter to current project
echo -e '\n*.xlsx diff=xlsx\n' >> $(git rev-parse --show-toplevel)/.git/info/attributes