Skip to content

Instantly share code, notes, and snippets.

View nikitasius's full-sized avatar
💭
🍆

Nikita S. nikitasius

💭
🍆
  • toxId: 4339E5C156D4858940E20F82BE6625BC69B4167EAE1E9924EF79AA474E2A454BE4323FE37C61
  • public static void main (String[] args){}
View GitHub Profile
@Hopfengetraenk
Hopfengetraenk / DeezerDownload.py
Created February 24, 2017 18:58
DeezerDownload
#!python2
#coding:latin
"""
Author: --<>
Purpose:
Download and decrypt songs from deezer.
The song is saved as a mp3.
No ID3 tags are added to the file.
The filename contains album, artist, song title.
@sihil
sihil / plambda.yaml
Created October 5, 2016 21:33
Snippet of some CloudFormation resources for Plambda
API:
Type: AWS::ApiGateway::RestApi
Properties:
Name:
Fn::Join:
- " "
- - Restorer Plambda
- Ref: Stage
Description: Experimental Restorer Play app in Lambda
@paulkearney
paulkearney / cleanup-codecommit-repos.sh
Created September 25, 2015 18:20
Migrating from GitHub to AWS CodeCommit
while read r; do
echo $r
aws codecommit delete-repository --repository-name $r --region us-east-1
done < ~/dev/utility-scripts/aws/codecommit/repos.txt
@Pelirrojo
Pelirrojo / apigateway-proxy-cloudformation-template.yaml
Created January 17, 2019 20:35
A Cloudformation Script to deploy an API Gateway Proxy
# LICENSE https://creativecommons.org/licenses/by-nc-sa/3.0/
# https://cjohansen.no/aws-apigw-proxy-cloudformation/
AWSTemplateFormatVersion: 2010-09-09
Description: An API that proxies requests to another HTTP endpoint
Resources:
Api:
Type: 'AWS::ApiGateway::RestApi'
Properties:
@alexjs
alexjs / cors-nginx.conf
Created November 28, 2012 22:42 — forked from michiel/cors-nginx.conf
Slightly tighter CORS config for nginx
#
# Slightly tighter CORS config for nginx
#
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs
#
# Despite the W3C guidance suggesting that a list of origins can be passed as part of
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox)
# don't seem to play nicely with this.
#
@alopresto
alopresto / gpg_git_signing.md
Last active January 18, 2024 22:42
Steps to enable GPG signing of git commits.

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
  7. $ git add example.txt
  8. $ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)
@ishikawa
ishikawa / gist:88599
Created April 1, 2009 07:49
Java Sample Code for Calculating HMAC-SHA1 Signatures
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.SignatureException;
import java.util.Formatter;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
/**
@michiel
michiel / cors-nginx.conf
Created July 5, 2011 10:41
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@2E0PGS
2E0PGS / linux-usb-file-copy-fix.md
Last active April 29, 2024 15:21
Fix Ubuntu and other Linux slow/hanging file copying via USB.

If your running a x64 bit Ubuntu or other Linux and find USB transfers hang at the end apply this fix:

echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes
echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes

I suggest you edit your /etc/rc.local file to make this change persistant across reboots.

sudo nano /etc/rc.local

@subfuzion
subfuzion / curl.md
Last active May 1, 2024 18:04
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.