Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block bonyiii

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
bonyiii / gist:1471379
Created Dec 13, 2011
restore overwritten files linux
View gist:1471379
Assess which partition on your computer you need to access to recover the files.
Unmount the directory using the "unmount" command in the interface. This will help prevent damaging the file you are trying to recover.
Type "debugfs" in the command line interface (all typing without quotation marks) and include the file system where the overwritten file is into the command. For example, typing "debugfs usr/personal" will bring up your personal directory. Hit "Enter" after typing the command.
bonyiii / gist:6184489
Created Aug 8, 2013
ruby multithread
View gist:6184489
Concurrent Programming and Threads in Ruby - a reading list
02 April 2013
Many rubyists consider threads in Ruby as somewhat of an arcane knowledge, though in reality they’re a very well researched and understood concept. Of course, writing effective multithreaded concurrent programs requires certain amount of knowledge and discipline from the programmer, but there’s nothing that a smart one can’t learn if he wants to.
To help with the task, awesome @brainopia compiled a list of recommended reading on the topic of concurrency and threads. All kudos go to @brainopia, and the original list in Russian as available as a gist here:
bonyiii / gist:1901621
Created Feb 24, 2012
mysqlreport explanation
View gist:1901621
Other great tool:
Hack MySQL ‹ mysqlreport ‹ Download ‹ Guide › Documentation
Blog Contact Sitemap
This web site is no longer maintained. Read why.
bonyiii / gist:884681
Created Mar 24, 2011
How to create diff file for gentoo ebuild patch
View gist:884681

An example to patch unixODBC-2.3.0 on a 64bit machine to work with oracle 8.

First download unixODBC source. mkdir /tmp/unixODBC/source

Create two new folder. mkdir /tmp/unixODBC/patch/original mkdir /tmp/unixODBC/patch/unixODBC-2.3.0/DriverManager/

cp /tmp/unixODBC/source/unixODBC-2.3.0/DriverManager/SQLConnect.c /tmp/unixODBC/patch/original
bonyiii /
Last active Jan 11, 2017
Start Rails Application
docker run -it \
--name sapi \
-p 3000:3000 \
--security-opt seccomp:chrome.seccomp.json \
-v /home/boni/public_html/app/my-api/gems:/usr/local/bundle \
-v /home/boni/public_html/app/my-api:/var/www/my-api \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $HOME/Downloads:/home/dev/Downloads \
-v $HOME/.config/google-chrome/:/home/dev/data \
set -e
case "$1" in
# ensure the right database adapter is active in the Gemfile.lock
if [ -z "$NO_BUNDLE" ]; then
# bundle install --without development test
bundle install
chown dev:dev $GEM_HOME -R
bonyiii / rails_api.Dockerfile
Created Dec 19, 2016
Rails application dockerfile
View rails_api.Dockerfile
FROM myapp-base
RUN mkdir -p /var/www/myapp-api && chown dev /var/www/myapp-api
WORKDIR /var/www/myapp-api
bonyiii / base_imgage.Dockerfile
Created Dec 19, 2016
How to set up rails development with docker base image
View base_imgage.Dockerfile
# original idea taken from
FROM ruby:2.3
MAINTAINER Bonaventura Fleischmann <>
# Add user whose name the app will be run within the container
# the user id should be the default first linux user id
RUN useradd -u 1000 dev
bonyiii / gist:2158289
Created Mar 22, 2012
Rails ajax link_to remote with put, post
View gist:2158289
Key thing is to add form_authenticity_token to path param as a query_string
<%= link_to 'Reset', null_counter_model_path(model, :authenticity_token => form_authenticity_token), :confirm => 'Are you sure?', :method => :put, :remote => true %>
bonyiii / mailer.rb
Created Jul 31, 2016
Redmine mailer with sending attachments
View mailer.rb
# Redmine - project management software
# Copyright (C) 2006-2016 Jean-Philippe Lang
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
You can’t perform that action at this time.