Skip to content

Instantly share code, notes, and snippets.

@prasathmani
prasathmani / upload-to-google-drive.py
Last active May 3, 2024 11:40
upload files to google drive using python
import requests, json
# Get refresh token from google drive api
# Generating a refresh token for DRIVE API calls using the OAuth playground
# https://www.youtube.com/watch?v=hfWe1gPCnzc
def getToken():
oauth = 'https://www.googleapis.com/oauth2/v4/token' # Google API oauth url
headers = {'content-type': 'application/x-www-form-urlencoded'}
data = {
'grant_type': 'refresh_token',
@andreasonny83
andreasonny83 / RELEASE-NOTES.md
Last active May 3, 2024 11:36
Release Notes Template

Release Notes Template

Based off https://palantir.quip.com/pzRwAVr1bpzf

Pro-tip: look through the github diff between the previous release to see what's changed. The commit titles should give an outline of what's happened.

Upgrade Steps

  • List out, as concretely as possible, any steps users have to take when they upgrade beyond just dumping the dependency.
  • Write pseudocode that highlights what code should change and how.
@andyshinn
andyshinn / README.md
Last active May 3, 2024 11:21
Terraform variables per-workspace
$ terraform workspace new staging   
Created and switched to workspace "staging"!

You're now on a new, empty workspace. Workspaces isolate their state,
so if you run "terraform plan" Terraform will not see any existing state
for this configuration.
@daveh
daveh / form.html
Last active May 3, 2024 11:17
Generate a PDF with PHP (code to accompany https://youtu.be/XGS732DLtDc)
<!DOCTYPE html>
<html>
<head>
<title>PDF Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css">
</head>
<body>
<h1>Example</h1>
@dayt0n
dayt0n / bfrestrict.py
Last active May 3, 2024 11:09
quickly bruteforce iOS restrictions passcode
# bfrestrict.py - bruteforce iOS restrictions passcode
#
# if you don't have an unencrypted backup folder ready, just plug in the device and run this program
#
# Note: make sure you have libimobiledevice installed (we need idevicebackup2) if you plan to plug-and-play
#
# made by Dayton Hasty (c)2018
import os
import sys
import hashlib
@ramanujadasu
ramanujadasu / go-interview-questions.md
Created August 2, 2021 10:29 — forked from sadhasivam/go-interview-questions.md
Golang Interview Questions
  • Installation: 1- Explain how Go path works? 2- What are the benefits of Go Module (reference its commands)?

  • Concurrency: 1- Explain Concurrency & when to use it? 2- How would you allow communication between goroutines in Go? 3- How would you manage their access to resources?

  1. why do you use Go (my answer was as simple as "why i shouldn't", and some extra points Grimacing face)
@fnky
fnky / ANSI.md
Last active May 3, 2024 10:48
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@phaneesh
phaneesh / fstab
Created February 19, 2019 10:04
hadoop-os-tuning
/dev/sdb1 /data/hdp01 xfs defaults,noatime,nodiratime,nobarrier 1 2
/dev/sdc1 /data/hdp02 xfs defaults,noatime,nodiratime,nobarrier 1 2
@leosouzadias
leosouzadias / kernel-entries-for-hadoop.md
Last active May 3, 2024 10:46
Kernel entries for Hadoop

Kernel entries for Hadoop - Tuning

Should be added to either /etc/sysctl.conf or /etc/sysct.conf.d/99-hadoop.conf

File contents:

# Sysctl for hadoop nodes

net.core.netdev_max_backlog = 4000
net.core.somaxconn = 4000
@ReinierC
ReinierC / calc.inc.php
Last active May 3, 2024 10:42
PHP OOP Calculator
<?php
class Calc {
public $num1;
public $num2;
public $cal;
public function __construct($num1Inserted, $num2Inserted, $calInserted) {
$this->num1 = $num1Inserted;