Skip to content

Instantly share code, notes, and snippets.

View jbwl's full-sized avatar
🐫
Spooling....

"Jon" jbwl

🐫
Spooling....
View GitHub Profile
/home/user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-sqlserver-adapter-3.2.13/lib/active_record/connection_adapters/sqlserver/database_statements.rb:416:in `each': TinyTds::Error: Adaptive Server connection timed out: EXEC sp_executesql N'SELECT COUNT(*) FROM MYBIGTABLE' (ActiveRecord::StatementInvalid)
from /home/user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-sqlserver-adapter-3.2.13/lib/active_record/connection_adapters/sqlserver/database_statements.rb:416:in `handle_to_names_and_values_dblib'
from /home/user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-sqlserver-adapter-3.2.13/lib/active_record/connection_adapters/sqlserver/database_statements.rb:405:in `handle_to_names_and_values'
from /home/user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-sqlserver-adapter-3.2.13/lib/active_record/connection_adapters/sqlserver/database_statements.rb:377:in `_raw_select'
from /home/user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-sqlser
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "activerecord"
gem "sqlite3"
gem "searchkick", git: "https://github.com/ankane/searchkick.git"
end
@jbwl
jbwl / mysql2-catalina.md
Created February 12, 2021 13:38 — forked from fernandoaleman/mysql2-catalina.md
Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Catalina with MySQL 5.7.

Solution

Make sure openssl is installed on Mac via Homebrew.

brew install openssl
  • mutagen をインストールする
$ brew install mutagen-io/mutagen/mutagen
  • mutagen.yml をプロジェクトルートへ作成する
sync:
@jbwl
jbwl / autossh.service
Created October 28, 2021 10:26 — forked from thomasfr/autossh.service
Systemd service for autossh
[Unit]
Description=Keeps a tunnel to 'remote.example.com' open
After=network.target
[Service]
User=autossh
# -p [PORT]
# -l [user]
# -M 0 --> no monitoring
# -N Just open the connection and do nothing (not interactive)
@jbwl
jbwl / sftp-setup-ssh-keys.sh
Created November 23, 2021 15:22 — forked from angrychimp/sftp-setup-ssh-keys.sh
Setting up SSH keys for key-auth with ProFTPd (w/ SFTP module)
#!/bin/bash
USERNAME="your username here"
SFTPHOST="your sftp host"
SFTPPORT=22 # or other port, if non-standard
# Create SSH key-pair for SFTP access
# (creates pair with no passphrase)
ssh-keygen -b 2048 -t rsa -C "$SFTPHOST" -N "" -f ~/.ssh/id_rsa.sftp
@jbwl
jbwl / killbutmakeitlooklikeanaccident.sh
Created July 17, 2022 16:33 — forked from moyix/killbutmakeitlooklikeanaccident.sh
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
@jbwl
jbwl / move.ts
Created July 28, 2023 21:50 — forked from IlCallo/move.ts
Apply Drag and Drop to QTable rows using SortableJs
// Taken from https://github.com/angular/components/blob/master/src/cdk/drag-drop/drag-utils.ts
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/