Skip to content

Instantly share code, notes, and snippets.

View zedalaye's full-sized avatar

Pierre Yager zedalaye

View GitHub Profile
@zedalaye
zedalaye / build_der_from_raw_private_key.rb
Created August 17, 2023 16:41
Instanciate an OpenSSL::PKey::EC from a raw private key
# Tested using
# Ruby v3.2.2 / openssl gem v3.1.0
# Ubuntu with OpenSSL 3.0.2
require 'openssl'
class ECKey
CURVE='prime256v1'
@zedalaye
zedalaye / Gemfile
Last active January 25, 2023 10:12
ArchEthic WebSocket client in Ruby
source "https://rubygems.org"
gem "async-websocket"
@zedalaye
zedalaye / README.md
Created May 19, 2022 14:53
Load sensitive code from encrypted files in Ruby

Sensitive

This code demonstrate how to load sensitive code from encrypted files at runtime.

$ ruby sample.rb

Now, protect the sensitive code

Keybase proof

I hereby claim:

  • I am zedalaye on github.
  • I am zedalaye (https://keybase.io/zedalaye) on keybase.
  • I have a public key ASCQiR8V17vuAwTO2MsOKJ-8ORLxnV-RNndlRl_WO5MLVgo

To claim this, I am signing this object:

@zedalaye
zedalaye / build_zeromq_vs2017.bat
Last active October 24, 2019 08:04
Build ZeroMQ (LibZMQ/CZMQ/Zyre) Ecosystem from sources on Windows using Visual Studio 2017
@echo off
setlocal EnableDelayedExpansion
@REM Build LibZMQ, CZMQ et Zyre with their dependencies
@REM Toolchain : Visual Studio 2017
@REM Dependencies : CMAKE, GIT (Git for Windows), PERL (Strawberry Perl), NASM
@REM
@REM After successful build the resulting DLL are moved into zmq_build_%TODAY%\out
@REM
@zedalaye
zedalaye / Gemfile
Last active June 5, 2017 13:25
Test Mailjet Resource#save from Mailjet-Gem
source 'https://rubygems.org'
ruby '2.4.1'
gem 'mail'
gem 'mailjet', git: 'https://github.com/mailjet/mailjet-gem.git', branch: 'prerelease/v1.5.2'
gem 'activesupport', :require => 'active_support/all'
@zedalaye
zedalaye / user_data
Created July 17, 2015 13:56
My deix cloudconfig for coreos running on xen
#cloud-config
---
hostname: %XSVMNAMETOHOSTNAME%
ssh_authorized_keys:
# - ssh-rsa <my key !>
# The following entry will automatically be replaced with a public key
# generated by XenServer's container management. The key-entry must exist,
# in order to enable container management for this VM.
- ssh-rsa %XSCONTAINERRSAPUB%
coreos:
@zedalaye
zedalaye / update-testing-db.rb
Last active January 25, 2016 01:04
Synchronize database between 2 apps at Scalingo
#!/usr/bin/env ruby
require 'uri'
require 'pty'
require 'expect'
if ARGV.length == 2
app = ARGV[0]
dump = ARGV[1]
else
$ LC_ALL=C bin/rbx -X19 gem install nmatrix
Building native extensions. This could take a while...
ERROR: Error installing nmatrix:
ERROR: Failed to build gem native extension.
/home/pierre/Sources/rubinius/bin/rbx extconf.rb
checking for main() in -llapack... yes
checking for main() in -lcblas... yes
checking for main() in -latlas... yes
checking for clapack.h... no
@zedalaye
zedalaye / README
Last active October 27, 2015 23:16
How to migrate your PostgreSQL Database from Shelly Cloud to Scalingo
1) Make sure you have these tools installed and configured
* Ruby
* The ShellyCloud CLI
* The Scalingo CLI
* tar, gunzip
* The PostgreSQL client tools (pg_restore)
2) Make sure your database on scalingo side is empty (delete your postgresql addon and recreate it)
BEWARE : YOU WILL LOOSE ALL YOUR DATA ! So make backups before deleting your PG Addon !