Skip to content

Instantly share code, notes, and snippets.

View viktorchukhantsev's full-sized avatar

Viktor Chukhantsev viktorchukhantsev

View GitHub Profile
@viktorchukhantsev
viktorchukhantsev / 00-android-bypass-certificate-pinning-and-mitm-attack-setup.md Certificate Pinning Bypassing: Setup with Frida, mitmproxy and Android Emulator with a writable file system
The AWS Client VPN for Linux is only provided for Ubuntu as a .deb package. I need it for Fedora. This was tested on Fedora 33.
https://docs.aws.amazon.com/vpn/latest/clientvpn-user/client-vpn-connect-linux.html
Get the vpn client deb package.
```
curl https://d20adtppz83p9s.cloudfront.net/GTK/latest/awsvpnclient_amd64.deb -o awsvpnclient_amd64.deb
```
Install `alien` to convert the deb package to rpm.
@viktorchukhantsev
viktorchukhantsev / my_jobs.rb
Created April 20, 2020 08:24
Simple jobs queue implementation on Ruby
module MyJobs
def self.backend
@backend
end
def self.backend=(backend)
@backend = backend
end
class Processor
curl -XDELETE 'localhost:9200/test'
curl -XPUT 'localhost:9200/test/doc/1' -d '
{
"sentence" : "Hi!",
"value" : 1
}
'

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l
@viktorchukhantsev
viktorchukhantsev / assert_url_helper.rb
Created August 5, 2018 19:24 — forked from dblock/assert_url_helper.rb
A monkey patch for serving compressed assets for Rails 3.0 (asset_tag_helper.rb) and another for Rails 3.1 (asset_paths.rb).
# Rails 4
require 'action_view/helpers/asset_url_helper'
module ActionView
module Helpers
module AssetUrlHelper
def accept_encoding?(encoding)
request = self.request if respond_to?(:request)
return false unless request
@viktorchukhantsev
viktorchukhantsev / article.rb_product.rb
Created April 11, 2016 10:35 — forked from lexmag/article.rb_product.rb
Two-way polymorphic models / Polymorphic HABTM association
class Article < ActiveRecord::Base # Product class is similar
belongs_to :user
has_many :media, as: :ownable
with_options through: :media, source: :representable do |assn|
assn.has_many :videos, source_type: 'Video'
assn.has_many :images, source_type: 'Image'
end
end
RSpec::Core::RakeTask.module_eval do
def pattern
dir = EngineName.root # replace with you the name of your engine
extras = []
if File.directory?( dir )
extras << File.join( dir, 'spec', '**', '*_spec.rb' ).to_s
end
[@pattern] | extras
end
end