Skip to content

Instantly share code, notes, and snippets.

@svoboda-jan
svoboda-jan / curl.md
Created June 20, 2024 06:18 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@svoboda-jan
svoboda-jan / smstools-eventhandler.sh
Created June 9, 2024 10:56 — forked from x-magic/smstools-eventhandler.sh
SMS Server Tools 3 event handler script (mainly used for converting messages to UTF-8 encoding, for example, those messages with CJK characters included)
#!/bin/bash
#
# This script processes events from smsd.
# It mainly will converts SMS encoded with UCS2 encoding to UTF-8 format expected by many other applications.
# To use it, edit your /etc/smsd.conf and add the following line:
#
# eventhandler = /path/to/smstools-eventhandler.sh
#
# When a new message is received in /var/spool/incoming/, message files with following header line will be converted:
#
@svoboda-jan
svoboda-jan / smstools-eventhandler.sh
Created June 9, 2024 10:56 — forked from x-magic/smstools-eventhandler.sh
SMS Server Tools 3 event handler script (mainly used for converting messages to UTF-8 encoding, for example, those messages with CJK characters included)
#!/bin/bash
#
# This script processes events from smsd.
# It mainly will converts SMS encoded with UCS2 encoding to UTF-8 format expected by many other applications.
# To use it, edit your /etc/smsd.conf and add the following line:
#
# eventhandler = /path/to/smstools-eventhandler.sh
#
# When a new message is received in /var/spool/incoming/, message files with following header line will be converted:
#
@svoboda-jan
svoboda-jan / mysql57-in-centos7.md
Created May 19, 2024 13:04 — forked from linuxkathirvel/mysql57-in-centos7.md
Install MySQL 5.7 in CentOS7/RHEL7

MySQL 5.7 installation in CentOS 7

sudo su

# Remove MariaDB packages
yum list installed | grep -i maria
yum remove mariadb.x86_64
yum remove mariadb-libs.x86_64

# Download MySQL 5.7 RPM tar

Change Apple OS X Dock size from Apple Terminal

defaults write com.apple.dock tilesize -int 32; killall Dock

32 is icon size

@svoboda-jan
svoboda-jan / run-puma
Created June 29, 2016 18:21
Updated heler script for Puma init script for Debian 8.5
#!/bin/bash
# on system boot, and root have no rbenv installed,
# after start-stop-daemon switched to current user, we have to init rbenv
if [ -d "$HOME/.rbenv/bin" ]; then
PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
eval "$(rbenv init -)"
elif [ -d "/usr/local/rbenv/bin" ]; then
PATH="/usr/local/rbenv/bin:/usr/local/rbenv/shims:$PATH"
eval "$(rbenv init -)"
@svoboda-jan
svoboda-jan / puma
Created June 29, 2016 16:51
Updated Puma init script for Debian 8.5
#! /bin/sh
### BEGIN INIT INFO
# Provides: puma
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@svoboda-jan
svoboda-jan / Gemfile
Last active January 27, 2016 16:10 — forked from rkh/Gemfile
jquery-sinatra-streaming - A server-side service outputs a long response using Sinatra's streaming API.
source "http://rubygems.org/"
gem "sinatra", "~> 1.3.0"
gem "thin"
@svoboda-jan
svoboda-jan / database.yml
Created September 9, 2015 21:15
Example Redmine database.yml configuration for FirebirdSQL database (https://github.com/svoboda-jan/redmine/tree/firebirdsql)
production:
adapter: fb
database: ~/Documents/redmine/db/redmine.fdb
username: SYSDBA
password: masterkey
host: localhost
encoding: UTF-8
create: true
development:
@svoboda-jan
svoboda-jan / tenant_model.rb
Created August 18, 2015 13:29
Very simple multi-tenancy for Rails (shared database)
module TenantModel
def self.included(base)
base.extend ClassMethods
base.instance_eval do
acts_as_tenant
end
end
class InvalidTenant < SecurityError; end