Skip to content

Instantly share code, notes, and snippets.

View nilesolutions's full-sized avatar

Ahmed Samy nilesolutions

  • Abu dhabi
View GitHub Profile
@nilesolutions
nilesolutions / example.js
Created September 19, 2019 13:43 — forked from na0AaooQ/example.js
AWS LambdaでAmazon RDS for MySQLへ接続する(Node.js 4.3 + KMSで暗号化したMySQL接続パスワードをkms.decryptで復号化してMySQLヘ接続 + バッチ実行をSNS通知する) ref: http://qiita.com/na0AaooQ/items/ff9ab6ce9831236b3ea6
var AWS = require('aws-sdk');
var mysql = require('mysql');
// KMSにより暗号化したMySQL接続用のパスワード文字列
var kmsEncyptedToken = "CiC*********(KMSで暗号化したMySQL接続用のパスワード文字列)***********UI=";
// 接続先のMySQLサーバ情報
var mysql_host = "example-rds-mysql-server.carvmoii2uds.ap-northeast-1.rds.amazonaws.com";
var mysql_user = "example_user";
var mysql_dbname = "exampledb";
@nilesolutions
nilesolutions / index.js
Created October 25, 2019 08:28 — forked from kingkool68/index.js
AWS Lambda Function for Proxying Requests to S3
/**
* This is a simple AWS Lambda function that will look for a given file on S3 and return it
* passing along all of the headers of the S3 file. To make this available via a URL use
* API Gateway with an AWS Lambda Proxy Integration.
*
* Set the S3_REGION and S3_BUCKET global parameters in AWS Lambda
* Make sure the Lambda function is passed an object with `{ pathParameters : { proxy: 'path/to/file.jpg' } }` set
*/
var AWS = require('aws-sdk');
@nilesolutions
nilesolutions / ImageProcess.js
Created November 9, 2019 20:31 — forked from tpai/ImageProcess.js
Lambda function for create thumbnail.
// dependencies
var async = require('async');
var path = require('path');
var AWS = require('aws-sdk');
var gm = require('gm').subClass({
imageMagick: true
});
var util = require('util');
var LambdaWatermark = require('lambda-watermark');
@nilesolutions
nilesolutions / html5.html
Created January 13, 2020 19:15 — forked from sovietspy2/html5.html
the best of html5
<header>
<h1>Super duper best blog ever</h1>
<nav>
<a href="/">Home</a>
<a href="/about">About</a>
<a href="/archive">Archive</a>
</nav>
</header>
<main>
<article>
@nilesolutions
nilesolutions / semantic-html-ex5.html
Created January 13, 2020 19:16 — forked from michaelkornblum/semantic-html-ex5.html
Simple blogsite markup with Semantic HTML5 tags.
[...]
<div class="wrapper">
<header>
<h1>Logo</h1>
<nav>
<ul>
<li><a href="link-1.html">Link 1</a></li>
<li><a href="link-2.html">Link 2</a></li>
<li><a href="link-3.html">Link 3</a></li>
</ul>
@nilesolutions
nilesolutions / sw.js
Created February 14, 2020 19:53 — forked from jarodium/sw.js
Service Worker
'use strict';
var cacheVersion = 1;
var currentCache = {
offline: 'offline-cache' + cacheVersion
};
const offlineUrl = 'offline.html';
this.addEventListener('install', event => {
event.waitUntil(
<?xml version="1.0" encoding="UTF-8"?>
<!--
SUMMARY:
- Structure: NML2 SNI Text
- Based On: NAR v1.2_1, NML2 v2.1_1
AUTHOR: thomsonreuters.com
-->
<!-- ========================================================= -->
<newsMessage xmlns="http://iptc.org/std/nar/2006-10-01/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rtr="http://www.reuters.com/ns/2003/08/content" xmlns:x="http://www.w3.org/1999/xhtml">
@nilesolutions
nilesolutions / minimize-and-float-video-on-scroll.css
Created April 18, 2020 19:02
JW Player Demo: Minimize and Float Video on Scroll
.player-container {
background-color: black;
}
.player-minimize .player-position {
background-color: white;
border-radius: 2px;
bottom: 20px;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.25);
left: 20px;
When performing security research or connecting over untrusted networks, it’s often useful to tunnel connections through a VPN in a public cloud. This approach helps conceal your origin and safeguard your traffic, contributing to OPSEC when interacting with malicious infrastructure or traversing hostile environments.
One way to accomplish this is to set up your own VPN server, as an alternative to relying on a commercial VPN service. The following tutorial explains how to deploy the Algo VPN software bundle on DigitalOcean (the link includes my referral code). I like using DigitalOcean for this purpose because it offers virtual machines (VMs) for as little as $5 per month; also, I find it easier to use than other cloud services.
Algo VPN Overview
Algo VPN is an open-source software bundle designed for self-hosted VPN services. It was designed by the folks at Trail of Bits to be easy to deploy, rely only on modern protocols and ciphers, and provide reasonable security defaults. Also, it doesn’t require dedic
@nilesolutions
nilesolutions / gist:1cd45bd0e2c5a9571f8e9d590e396cbc
Created July 5, 2020 21:43 — forked from harrisonde/gist:90431ed357cc93e12b51
Deploy Laravel 5 applications on AWS Elastic Beanstalk
# The following script will deploy a Laravel 5 applicaion on AWS Elastic Beanstalk.
# Add to .ebextensions at the root of your application and name your commands file (e.g., commands.config)
# -------------------------------- Commands ------------------------------------
# Use "commands" key to execute commands on the EC2 instance. The commands are
# processed in alphabetical order by name, and they run before the application
# and web server are set up and the application version file is extracted.
# ------------------------------------------------------------------------------
commands:
01updateComposer: