Skip to content

Instantly share code, notes, and snippets.

ficapy ficapy

Block or report user

Report or block ficapy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Nginx reverse proxy aws s3 resources.
proxy_cache_path /var/nginx/cache/aws/trueniu levels=2:2:2 use_temp_path=off keys_zone=aws_3:500m inactive=30d max_size=10g;
server {
listen 80;
server_name trueniu.com www.trueniu.com;
if ( $scheme = http ) {
return 301 https://www.trueniu.com$request_uri;
}
}
@arielzn
arielzn / ssh_run.py
Last active Dec 12, 2017
Running commands with paramiko on remote hosts defined on ssh_config
View ssh_run.py
#!/usr/bin/env python
import os
import paramiko
import argparse
import socket
import logging
def create_ssh_client(hostname):
@matejb
matejb / pipe_executor.go
Created Aug 10, 2017
simple Go pipe executor
View pipe_executor.go
package main
import (
"bytes"
"fmt"
"log"
"os/exec"
"strings"
)
@wassname
wassname / geojson2shapely.ipynb
Last active May 6, 2018
Convert any geojson to shapely
View geojson2shapely.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@peterforgacs
peterforgacs / Windows10AWSEC2.md
Last active Oct 31, 2019
Running Windows 10 on AWS EC2
View Windows10AWSEC2.md

Running Windows 10 on AWS EC2

Downloading the image

Download the windows image you want.

AWS vmimport supported versions: Microsoft Windows 10 (Professional, Enterprise, Education) (US English) (64-bit only)

So Home wont work.

View s3_post_upload.py
import base64
import datetime
import hashlib
import hmac
import io
import json
import mimetypes
import os
import uuid
from urllib.error import HTTPError, URLError
@denji
denji / README.md
Last active Nov 1, 2019 — forked from Cubixmeister/README.md
Simple Sentry docker-compose.yml
View README.md
  1. Download docker-compose.yml to dir named sentry
  2. Change SENTRY_SECRET_KEY to random 32 char string
  3. Run docker-compose up -d
  4. Run docker-compose exec sentry sentry upgrade to setup database and create admin user
  5. (Optional) Run docker-compose exec sentry pip install sentry-slack if you want slack plugin, it can be done later
  6. Run docker-compose restart sentry
  7. Sentry is now running on public port 9000
@AndreKR
AndreKR / draw_text.go
Created Mar 14, 2017
Three ways of drawing text in go
View draw_text.go
// Initialize an empty image
dest := image.NewRGBA(image.Rect(0, 0, 800, 300))
// Draw a white background
draw.Draw(dest, dest.Bounds(), &image.Uniform{color.White}, image.ZP, draw.Src)
// Read the font
fontBytes, err := ioutil.ReadFile(exeDir + "/DejaVuSans.ttf")
if err != nil {
@zhu327
zhu327 / structure.py
Last active Apr 4, 2018
data structure
View structure.py
# coding: utf-8
u"""
线性数据结构, 栈, 队列, deques, 容器结构, 数据项之间存在相对的位置
"""
class Stack(object):
u"""
栈 先进后出
@cguldogan
cguldogan / ExcelOperations.cs
Last active Mar 29, 2016
Read Excel in C#
View ExcelOperations.cs
public class ExcelOperations
{
public List<List<string>> Read(string filePath)
{
OleDbConnection conn = new OleDbConnection("Provider = Microsoft.ACE.OLEDB.12.0; Data Source = " + filePath + "; Extended Properties = 'Excel 8.0; HDR=NO'");
OleDbCommand cmd = new OleDbCommand("select * from [Sheet1$]", conn);
conn.Open();
OleDbDataReader dr = cmd.ExecuteReader();
You can’t perform that action at this time.