Skip to content

Instantly share code, notes, and snippets.

View saviour123's full-sized avatar

Saviour Gidi saviour123

View GitHub Profile
const makeRequest = async () => {
const value1 = await promise1()
const value2 = await promise2(value1)
return promise3(value1, value2)
}
@casprine
casprine / px to em(sass)
Created May 31, 2018 17:35
Sass mixins to convert px to em
$base: 15;
@function em($pixels, $context: $base) {
@if (unitless($pixels)) {
$pixels: $pixels * 1px;
}
@if (unitless($context)) {
$context: $context * 1px;
}
@chmouel
chmouel / nginx-ssl-configuration.conf
Created September 19, 2016 05:54
nginx-ssl-proxy-pass-configuration
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name blog.chmouel.com;
ssl on;
ssl_certificate /etc/letsencrypt/live/blog.chmouel.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/blog.chmouel.com/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

HTML5 Markup Template - Basic

A very basic starter template with fundamental HTML5 markup -- only the basics.

Based on HTML5 Bones | http://html5bones.com

@joshRpowell
joshRpowell / ruby2.5.0-command
Last active January 11, 2020 07:33
rvm install ruby 2.5.0 on macOS 10.13.2
•100% [I] ➜ rvm get master && rvm list known
Downloading https://get.rvm.io
Downloading https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer.asc
Verifying /Users/jpowell/.rvm/archives/rvm-installer.asc
gpg: Signature made Sat Sep 9 15:49:18 2017 EDT
gpg: using RSA key E206C29FBF04FF17
gpg: Good signature from "Michal Papis (RVM signing) <mpapis@gmail.com>" [unknown]
gpg: Note: This key has expired!
Primary key fingerprint: 409B 6B17 96C2 7546 2A17 0311 3804 BB82 D39D C0E3
Subkey fingerprint: 62C9 E5F4 DA30 0D94 AC36 166B E206 C29F BF04 FF17
@jpate24
jpate24 / gist:2fdbed3dbc25413bf62e0f28c5881a45
Created October 1, 2020 17:58
Shell code to delete available volumes on the AWS console
#for machine in $(aws ec2 describe-regions --output text | awk {'print $4'})
#do
# echo $machine
#done
for volume in $(aws ec2 describe-volumes --region us-east-1 --output text | grep available | awk '{print $8}' | grep vol | tr '\n' ' ')
do
echo "deleting $volume"
aws ec2 delete-volume --volume-id $volume
@dantheman213
dantheman213 / HttpGetRequestSync.cs
Created July 30, 2015 23:41
C# HTTP GET request synchronous example
using System.Net.Http;
using (var client = new HttpClient())
{
var url = "http://google.com/api-example";
var response = client.GetAsync(url).Result;
if (response.IsSuccessStatusCode)
{
// by calling .Result you are performing a synchronous call
@saviour123
saviour123 / script.sh
Last active April 8, 2021 09:13
DB_Scripts
### MONGO
db.createUser({user: "mongo-admin", pwd: "password", roles:[{role: "root", db: "admin"}]})
mongo -u dsals -p --authenticationDatabase dbname
### Create MYSWL User and grant the user ready only.
create user 'username'@'%' identified by ‘password‘;
grant select, show view on database_name.* to 'username'@'%' identified by 'password';
#The following commands helps cleaning a git repo when there are many pr that are done.
git pull --all
for gone in $(git branch -vv | grep ': gone]' | awk '{print $1}'); do git branch -D $gone; done
========== First =========
Lets compare both keys provided:
openssl rsa -pubin -inform PEM -text -noout < key1.pem
openssl rsa -pubin -inform PEM -text -noout < key2.pem
we can observe that both keys have SIMILAR modulus but DIFFERENT exponents:
after googling online on RSA attacks i found one for Common Modulus
Exploiting it according to me was not very trivial especially without solid background in crypto (google to the rescue)