Skip to content

Instantly share code, notes, and snippets.

@encryptblockr
encryptblockr / copy_csv_to_db.py
Created May 20, 2021 06:21 — forked from amulya349/copy_csv_to_db.py
This script can be used to copy a CSV file (with header) to a Postgres remote database.
#!/usr/bin/env/python
import psycopg2
# Get a database connection
dsn = "dbname=%s user=%s password=%s host=%s port=%s" % ('db_name','username','password','remote_host_ip','port')
conn = psycopg2.connect(dsn)
query = "COPY public.hiringpattern_new FROM stdin WITH CSV HEADER DELIMITER as ',' "
fp = open('csv_file_path', 'r')
/*!
* jQuery JavaScript Library v1.4.4
* http://jquery.com/
*
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
@encryptblockr
encryptblockr / .gitignore
Created August 21, 2021 17:17 — forked from md2perpe/.gitignore
StackOverflow 64497615
venv/
*.pyc
@encryptblockr
encryptblockr / Remote API via daemon.json.md
Created August 29, 2021 08:11 — forked from kekru/Remote API via daemon.json.md
Enable Docker Remote API via daemon.json
package main
import (
"github.com/gin-gonic/contrib/sessions"
"github.com/gin-gonic/gin"
"log"
"net/http"
"strings"
)
package main
import (
"database/sql"
"fmt"
_ "github.com/lib/pq"
"log"
"time"
)
@encryptblockr
encryptblockr / gorm_joins.go
Created January 27, 2022 19:59 — forked from kavirajk/gorm_joins.go
Understanding Joins in gorm
package main
import (
"fmt"
"log"
"github.com/jinzhu/gorm"
_ "github.com/lib/pq"
)
@encryptblockr
encryptblockr / main.go
Created February 2, 2022 00:26 — forked from tfogo/main.go
Example use of Change Streams in Go
package main
import (
"context"
"fmt"
"log"
"os"
"time"
fuzz "github.com/google/gofuzz" // Used for creating random todo items
@encryptblockr
encryptblockr / README.md
Created April 4, 2022 18:39 — forked from tomdaley92/README.md
Proxmox - SPICE Client setup for MacOS

Proxmox - SPICE client setup for MacOS

  1. Install a working (and compiled) version of virt-viewer. You may view the homebrew package's upstream source on GitHub.

    brew tap jeffreywildman/homebrew-virt-manager
    brew install virt-viewer
  2. Once that's installed should be able make a call remote-viewer with a pve-spice.vv file downloaded from proxmox web interface

@encryptblockr
encryptblockr / blog20181001-01.cfg
Created June 18, 2022 21:32 — forked from haproxytechblog/blog20181001-01.cfg
Using HAProxy as an API Gateway, Part 1
frontend api_gateway
bind :443 ssl crt /etc/hapee-1.8/certs/cert.pem
acl PATH_cart path_beg -i /cart
acl PATH_catalog path_beg -i /catalog
use_backend be_cart if PATH_cart
use_backend be_catalog if PATH_catalog
backend be_cart
server s1 10.0.0.3:80