Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Coding

mayeaux

💭
Coding
View GitHub Profile
View ssh.tunnel.sh
ssh my-ssh-user@ip.to.my.server.com -L <ANY_AVAILABLE_PORT_YOU_FANCY>:127.0.0.1:39017 -N
@mayeaux
mayeaux / connect-remote-mongo-via-ssh-tunnel.md
Created Nov 29, 2020 — forked from umidjons/connect-remote-mongo-via-ssh-tunnel.md
Create ssh tunnel and connect to the remote mongo database on command line
View connect-remote-mongo-via-ssh-tunnel.md

Create ssh tunnel and connect to the remote mongo database on command line

Assume followings:

/mykeys/.ssh/prodserver.pem - is a certificate file

umid - is a user name

111.111.111.111 - is a remote host, that mongodb runs

View youtube-dl.md5
# Quick start for youtube-dl
- https://github.com/ytdl-org/youtube-dl/
## Default usage
youtube-dl URL
## Download certain resolution
youtube-dl -f "best[height<=480]" URL
## Download certain extension
View jquery-headroom.css
.headroom {
position: fixed;
top: 0;
-webkit-transition: top 0.15s;
transition: top 0.15s;
}
.headroom-hidden {
top: -60px;
}
View gist:b4544264b93085e40ec818b7940f375d
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@mayeaux
mayeaux / nginx.conf
Created Apr 4, 2020 — forked from CSRaghunandan/nginx.conf
Nginx configuration for serving mp4 videos
View nginx.conf
#user nobody;
worker_processes 4;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
View Error: Message failed: 553 Relaying disallowed as @ the solution NodeMail Zoho
After searching for more than 6 hours trying to understand what is zoho's mail problem to send emails!
After i red lots lots of there answer with no helpul solution i found the issue was that you need to have the ``` sender ``` option
in your nodemailer option same like email with same sender name and sender email. like this : ``` from: '"senderNameSameLikeTheZohoOne" <emailname@yourwebsite.com>',```
my config :
```
const transporter = nodemailer.createTransport({
service:'Zoho',
host: 'smtp.zoho.com',
port: 465,
@mayeaux
mayeaux / web3-solc-contract-compile-deploy.js
Created Sep 8, 2019 — forked from tomconte/web3-solc-contract-compile-deploy.js
Compiling and deploying an Ethereum Smart Contract, using solc and web3.
View web3-solc-contract-compile-deploy.js
const fs = require('fs');
const solc = require('solc');
const Web3 = require('web3');
// Connect to local Ethereum node
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
// Compile the source code
const input = fs.readFileSync('Token.sol');
const output = solc.compile(input.toString(), 1);
@mayeaux
mayeaux / send.py
Created Aug 31, 2019 — forked from ivandru/send.py
Simple Ether Transfer on Ropsten
View send.py
import web3
import json
from eth_account import Account
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('https://ropsten.infura.io/v3/apiKey'))
acct = Account.privateKeyToAccount('private key')
nonce = w3.eth.getTransactionCount(acct.address)
transaction = {
'to' : toAccount,
'value': 1,