Skip to content

Instantly share code, notes, and snippets.

@qinjie
qinjie / github-ubuntu.sh
Last active May 11, 2024 13:41 — forked from MarHoff/github-ubuntu.sh
Setting up github on Ubuntu
#!/bin/bash
###############################################
# To use:
# wget https://raw.github.com/gist/4411254
# chmod 777 github-ubuntu.sh
# ./github-ubuntu.sh
###############################################
GIT_EMAIL=mark.qj@gmail.com
GIT_USER=qinjie
@qinjie
qinjie / Install psql on Amazon Linux 2.txt
Last active October 5, 2022 03:01
Install psql on Amazon Linux 2
```
sudo amazon-linux-extras install postgresql10
```
Use it to connec to Redshift database
```
psql -h <endpoint> -p <port> -d <databasename> -U <userid>
```
@qinjie
qinjie / install_mysql_client.sh
Created October 5, 2022 02:14 — forked from sshymko/install_mysql_client.sh
Install MySQL 5.7 client on Amazon Linux 2
#!/bin/sh
sudo yum install -y https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
sudo yum install -y mysql-community-client
@qinjie
qinjie / sugh.sh
Created August 24, 2022 14:16 — forked from erdincay/sugh.sh
su GitHub (downloading all repositories from a given user)
#!/bin/bash
if [ -z "$1" ]; then
echo "waiting for the following arguments: username + max-page-number"
exit 1
else
name=$1
fi
if [ -z "$2" ]; then
@qinjie
qinjie / python-download-file.md
Created August 19, 2022 11:04
Python download file using Requests

Download files using requests library.

Method 1:

import requests

def download_file(url: str)->str:
    local_filename = url.split('/')[-1]
 # 注意传入参数 stream=True
@qinjie
qinjie / mongodb_shell_commands.md
Last active August 19, 2022 10:52 — forked from michaeltreat/mongodb_shell_commands.md
Cheat Sheet for Mongo DB Shell commands

Cheat Sheet for MongoDB Shell Commands

This is a Cheat Sheet for interacting with the Mongo Shell ( mongo on your command line). This is for MongoDB Community Edition.

Preface:

Mongo Manual can help you with getting started using the Shell.

FAQ for MongoDB Fundamentals and other FAQs can be found in the side-bar after visiting that link.

@qinjie
qinjie / docker-useful-commands.md
Last active August 19, 2022 10:49 — forked from brenopolanski/docker-cp-container-host.md
Docker Useful Commands

To copy a file from container to host:

docker cp <containerId>:/file/path/within/container /host/path/target
@qinjie
qinjie / learning-google-apps-script.md
Last active August 19, 2022 10:54 — forked from labnol/google-apps-script.md
Resource to learn Google Apps Script

Learning Google Apps Script

The best resource for learning Google Script is the official documentation available at developers.google.com. Here are other places that will help you get up to speed.

  1. Google Apps Scripts - Snippets by +Amit Agarwal
  2. Apps Script Starter - Modern development workflow for building Google Apps Script projects with Babel, Webpack and VS Code.
  3. Digital Inspiration by +Amit Agarwal - Google Addons
  4. Awesome Google Scripts by +Amit Agarwal
  5. O'Reilly - Apps Script - by +James Ferreira
  6. Apps Script Webinars - YouTube - by +Eric Koleda
@qinjie
qinjie / project-readme-Template.md
Last active August 19, 2022 10:53 — forked from PurpleBooth/README-Template.md
Template Project README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@qinjie
qinjie / upload_folder_to_s3.py
Last active August 19, 2022 10:56 — forked from feelinc/UploadDirS3.py
Upload folder contents to AWS S3
#!/usr/bin/python
import os
import sys
import boto3
# get an access token, local (from) directory, and S3 (to) directory
# from the command-line
local_directory, bucket, destination = sys.argv[1:4]