Skip to content

Instantly share code, notes, and snippets.

View viktorchukhantsev's full-sized avatar

Viktor Chukhantsev viktorchukhantsev

View GitHub Profile
@miguelgmalpha
miguelgmalpha / gist:5c9e78d16312d156b0ec1d1c1bb09c1c
Last active April 30, 2024 18:57
AWS Client VPN with SAML for Fedora
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.
@approovm
approovm / 00-android-bypass-certificate-pinning-and-mitm-attack-setup.md
Last active July 2, 2024 19:10
Certificate Pinning Bypassing: Setup with Frida, mitmproxy and Android Emulator with a writable file system
@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
@prodeveloper
prodeveloper / working_with_image.md
Last active January 5, 2021 14:51
How to upload and use images on your Django application

Working with images

We now have everything we need to build a web app, except for images and other binary files. Your application will likely not get a lot of engagement if its not visual. In this lesson, we shall be adding the ability to upload images to your Posts api.

Since this will be a continuation from the class on Deploying to production you are adviced to start by cloning that workspace and then working from there.

Step 1

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev -y
sudo apt-get install libfreetype6 libfreetype6-dev -y
sudo apt-get install libfontconfig1 libfontconfig1-dev -y
cd ~
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2
sudo tar xvjf $PHANTOM_JS.tar.bz2
sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
@necojackarc
necojackarc / active_job_retry_controlable.rb
Last active June 30, 2021 13:20
To enable ActiveJob to control retry
module ActiveJobRetryControlable
extend ActiveSupport::Concern
DEFAULT_RETRY_LIMIT = 5
attr_reader :attempt_number
module ClassMethods
def retry_limit(retry_limit)
@retry_limit = retry_limit
@Vidimensional
Vidimensional / CopySQS.py
Created May 18, 2016 12:09
Copy between different SQS queues.
#!/usr/bin/env python
import json
import time
import argparse
import boto.sqs
from termcolor import cprint
@mperham
mperham / locktest.rb
Created April 23, 2016 20:04
Distributed Locking with Redis and Ruby
require 'benchmark'
require 'sidekiq-ent'
require 'redis-lock'
require 'redis-semaphore'
require 'ruby_redis_lock'
# monkey patch to remove exponential backoff in pmckee11-redis-lock,
# otherwise this benchmark does not complete successfully.
class Redis
class Lock
@syafiqfaiz
syafiqfaiz / how-to-copy-aws-rds-to-local.md
Last active June 22, 2024 20:31
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
@oelmekki
oelmekki / doc.md
Created December 30, 2015 19:37
Rails + Browserify + React + es7

1. Gemfile

gem 'browserify-rails', '1.5.0' # until fix: https://github.com/browserify-rails/browserify-rails/issues/101
gem 'react-rails'

Browserify-rails allows to use browserify within assets pipeline. React-rails is here only to allow to use #react_component (and thus, prerendering).

Note that jquery-rails can be removed from Gemfile, the npm version of jquery and jquery-ujs will be used instead.