Skip to content

Instantly share code, notes, and snippets.

View johanoloflindberg's full-sized avatar
💭
Ready to work 😃

WEBBAB johanoloflindberg

💭
Ready to work 😃
View GitHub Profile
@EngineerLabShimazu
EngineerLabShimazu / s3_uploader.sh
Created October 18, 2019 01:22
Schedule upload to S3
#!/bin/bash
# $ crontab -l
# * 23 * * * bash /path/to/s3_uploader.sh
# $ which aws
# /usr/local/bin/aws
# Add path to aws cli
PATH=$PATH:/usr/local/bin
#!/bin/sh
##
## For EdgeRouter Lite
## chmod 755 /etc/cron.weekly/dns-blacklist
##
BLACKLIST_URL=https://raw.githubusercontent.com/oznu/dns-zone-blacklist/master/dnsmasq/dnsmasq-server.blacklist
BLACKLIST_PATH=/etc/dnsmasq.d/blacklist.conf
WHITELIST_PATH=/config/dnsmasq-server.whitelist
@EuniceMadya
EuniceMadya / s3_download.py
Created June 2, 2019 02:52
Download file from S3 bucket
def download(filename, path):
s3.download_file(bucket_name, filename, path+filename) # the path is where you want to put you documents
@EuniceMadya
EuniceMadya / s3_multipart_upload.py
Created June 2, 2019 02:51
S3 upload (multipart upload multipartupload)
# this is a simplified version of seeing how to upload
# referencing from https://gist.github.com/teasherm/bb73f21ed2f3b46bc1c2ca48ec2c1cf5
import boto3
import os
from boto3.s3.transfer import TransferConfig
def upload_to_s3(filename, path):
bucket_name = 'BUCKET_name' #should be a bucket name
s3 = boto3.client('s3')
@netmin-net
netmin-net / index.html
Created April 23, 2019 01:54
Interactive SVG Info Graph
<svg class="bgGradSVG" viewBox="0 0 800 600" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMin slice">
<linearGradient id="bgGrad" gradientUnits="userSpaceOnUse" x1="400" y1="-1.795888e-008" x2="400" y2="600">
<stop offset="0" style="stop-color:#22A4CA"/>
<stop offset="0.61" style="stop-color:#115F9A"/>
</linearGradient>
<rect fill="url(#bgGrad)" width="100%" height="100%"/>
</svg>
<svg class="mainSVG" viewBox="0 0 800 600" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid meet">
@ruanbekker
ruanbekker / gist:23877bb7d30df60d939a32b183b88c42
Created March 13, 2019 19:03 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@dabrovnijk
dabrovnijk / IPv6_Gavlenet_short.txt
Created February 11, 2019 23:57
Edgerouter lite, Gavlenet, IPv6 settings, dhcpv6-pd
# Version: v1.10.8
# Build ID: 5142440
# Build on: 11/20/18 16:45
# Copyright: 2012-2018 Ubiquiti Networks, Inc.
# HW model: EdgeRouter Lite 3-Port
#
# Gavlenet Edgerouter lite
#
# I guess that this will work for other ISPs as well.
#
@hedqvist
hedqvist / functions.php
Created February 8, 2019 13:27
Ordernumber in ExternalReference 1
<?php
/**
* @snippet WooCommerce - Adds ordernumber to Fortnox ExternalInvoiceReference1 field
* @author Redlight Media AB / Christopher Hedqvist
* @compatible WooCommerce 3.5.3
*/
function redlight_fortnox_order_external_reference( $orderData, $order_id) {
$order = new WC_Order($order_id);
$orderData['Order']['ExternalInvoiceReference1'] = $order->get_order_number();
@xezpeleta
xezpeleta / edgerouter_dns.md
Created January 22, 2019 12:11
Dynamic DNS on the Ubiquiti EdgeRouter X

Ubiquiti EdgeRouter X: custom dynamic DNS

ssh ubnt@<your-ip>
configure

Obtain your public IP address behind a NAT: using ipinfo.io

@hedqvist
hedqvist / functions.php
Last active April 9, 2023 13:14
Fortnox AdministrativeFee
<?php
/**
* @snippet WooCommerce - Fortnox plugin by Redlight Media - Add fee to AdministrativeFee via functions.php
* @author Redlight Media AB / Christopher Hedqvist
* @compatible WooCommerce 3.2.5
*/
function redlight_fortnox_administrative_fee( $orderData, $order_id ) {
// Get the total fees of this order
$order = wc_get_order($order_id);
$fees = $order->get_fees();