Skip to content

Instantly share code, notes, and snippets.

@orange888
orange888 / upload_to_pcloud.sh
Created October 24, 2019 19:38 — forked from jarvisluong/upload_to_pcloud.sh
Upload file to Pcloud via Rest API
#!/bin/bash
while :
do
zip -r $ZIP_FILENAME $FOLDERNAME && curl -F 'filename=@$ZIP_FILENAME' 'https://api.pcloud.com/uploadtolink?code=$PCLOUD_UPLOAD_CODE' && rm -f $ZIP_FILENAME && sleep $SLEEPTIME
done
#ZIP_FILENAME: file name of the zip you want to name it
#FOLDERNAME: the folder you want to zip
#PCLOUD_UPLOAD_CODE: go to pcloud, generate an upload link, you will find the code
#SLEEPTIME: the sleep interval for each upload cycle, if you want this to be a loop
@orange888
orange888 / curl.md
Created October 25, 2019 19:17 — forked from subfuzion/curl.md
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.

@orange888
orange888 / README.md
Created November 1, 2019 03:17 — forked from eddiejaoude/README.md
Install Firefox addon/extension with no user interaction
Download Google Drive files with WGET
Example Google Drive download link:
https://docs.google.com/open?id=[ID]
To download the file with WGET you need to use this link:
https://googledrive.com/host/[ID]
Example WGET command:
@orange888
orange888 / crypt_unlock.sh
Created November 8, 2019 07:16 — forked from gusennan/crypt_unlock.sh
initramfs-hook for unlocking LUKS-encrypted LVM partition
#!/bin/sh
PREREQ="dropbear"
prereqs() {
echo "$PREREQ"
}
case "$1" in
prereqs)
@orange888
orange888 / SeleniumGridTutorial.md
Created November 9, 2019 08:51 — forked from dzitkowskik/SeleniumGridTutorial.md
A simple tutorial of using selenium grid in python unittests

Prepare files & libraries

  1. Download selenium standalone server from: http://goo.gl/rQhaxb, Create local folder at ~/selenium and copy or move jar to that path:
$ mkdir ~/selenium
$ cd ~/selenium
$ wget http://goo.gl/rQhaxb
$ mv selenium-server-standalone-2.49.1.jar ~/selenium/
@orange888
orange888 / mongo_to_csv.py
Created November 11, 2019 00:11 — forked from mieitza/mongo_to_csv.py
python mongo to csv use pandas.
# @Author: xiewenqian <int>
# @Date: 2016-11-28T20:35:09+08:00
# @Email: [email protected]
# @Last modified by: int
# @Last modified time: 2016-12-01T19:32:48+08:00
import pandas as pd
from pymongo import MongoClient
@orange888
orange888 / import_csv_to_mongo
Created November 11, 2019 00:11 — forked from mprajwala/import_csv_to_mongo
Store CSV data into mongodb using python pandas
#!/usr/bin/env python
import sys
import pandas as pd
import pymongo
import json
def import_content(filepath):
mng_client = pymongo.MongoClient('localhost', 27017)

NOTE -

  • Remove -h option if you are doing operation on same machine
  • Remove -u , -p option if your database don't have username and password

Binary

Import database

mongorestore -h IP:port -d DB_Name -u user_name -p password <input db directory>
@orange888
orange888 / index.html
Created November 12, 2019 10:50 — forked from primaryobjects/index.html
Calling a React component's methods from outside of React. Demo https://plnkr.co/edit/E6lPrL331KGxoikGinFm?p=preview
<!DOCTYPE html>
<html>
<head>
<script data-require="[email protected]" data-semver="3.1.1" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script data-require="tether@*" data-semver="1.4.0" src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js"></script>
<link data-require="[email protected]" data-semver="4.0.5" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" />
<script data-require="[email protected]" data-semver="4.0.5" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js"></script>
<script data-require="react@*" data-semver="15.5.0" src="https://cdnjs.cloudflare.com/ajax/libs/react/15.5.0/react.min.js"></script>
<script data-require="react@*" data-semver="15.5.0" src="https://cdnjs.cloudflare.com/ajax/libs/react/15.5.0/react-dom.min.js"></script>