How to have a simple debian repository to offer your packages.
You probably have them already installed
- Python (I used 2.7).
- dpkg-scanpackages:
sudo apt-get install dpkg-dev
- gzip:
sudo apt-get install gzip
package xmlparser | |
import ( | |
"os" | |
"golang.org/x/text/encoding/charmap" | |
"log" | |
"bytes" | |
"io" | |
"strings" | |
) |
// CSVToMap takes a reader and returns an array of dictionaries, using the header row as the keys | |
func CSVToMap(reader io.Reader) []map[string]string { | |
r := csv.NewReader(reader) | |
rows := []map[string]string{} | |
var header []string | |
for { | |
record, err := r.Read() | |
if err == io.EOF { | |
break | |
} |
package main | |
import ( | |
"bytes" | |
"fmt" | |
"os/exec" | |
"strings" | |
) | |
func main() { |
This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.
I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/
in my Dockerfiles, and also work from
isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/
.
At the end of the day, vendoring (and committing vendor/
) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:
# | |
# TO-DO: set |DESTINATIONURL| below to be whatever you want e.g. www.google.com. Do not include "http(s)://" as a prefix. All matching requests will be sent to that url. Thanks @Meatballs__! | |
# | |
# Note this version requires Apache 2.4+ | |
# | |
# Save this file into something like /etc/apache2/redirect.rules. | |
# Then in your site's apache conf file (in /etc/apache2/sites-avaiable/), put this statement somewhere near the bottom | |
# | |
# Include /etc/apache2/redirect.rules | |
# |
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
### Ubuntu Xexial Xerus 16.04 | |
wget http://swupdate.openvpn.org/as/openvpn-as-2.1.12-Ubuntu16.amd_64.deb | |
passwd passwd openvpn | |
Admin UI: https://publicIPaddress:943/admin | |
Client UI: https://publicIPaddress:943/ | |
go to Server Network Settings -> Hostname or IP Address: | |
change it from private IP to public IP |
#!/usr/bin/env python3 | |
''' | |
bling.py - extract keys from macOS keychains. | |
installation: | |
pip install pytz hexdump vivisect-vstruct-wb tabulate argparse pycryptodome | |
usage: | |
python bling.py /path/to/keychain-db <password> ./path/to/output/directory |