- C-a == Ctrl-a
- M-a == Alt-a
:q close
:w write/saves
:wa[!] write/save all windows [force]
:wq write/save and close
# add to ~/.bash_profile, and close/reopen a shell. Will autocomplete any hosts found in known_hosts. | |
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh |
#!/bin/bash | |
echo "Generating an SSL private key to sign your certificate..." | |
openssl genrsa -des3 -out myssl.key 1024 | |
echo "Generating a Certificate Signing Request..." | |
openssl req -new -key myssl.key -out myssl.csr | |
echo "Removing passphrase from key (for nginx)..." | |
cp myssl.key myssl.key.org | |
openssl rsa -in myssl.key.org -out myssl.key |
Configure local wildcard DNS server
sudo apt-get install dnsmasq
/etc/NetworkManager/NetworkManager.conf
and comment out (#
) the line that reads dns=dnsmasq
. Restart NetworkManager afterwards: sudo restart network-manager
./etc/dnsmasq.conf
, and adding the line listen-address=127.0.0.1
./etc/dnsmasq.d
(eg. /etc/dnsmasq.d/dev
), and add the line address=/dev/127.0.0.1
to have dnsmasq resolve requests for *.dev domains. Restart Dnsmasq: sudo /etc/init.d/dnsmasq restart
.source: http://brunodbo.be/blog/2013/04/setting-up-wildcard-apache-virtual-host-wildcard-dns
. | |
├── books | |
│ ├── handlers.go | |
│ └── models.go | |
├── config | |
│ └── db.go | |
└── main.go |
. | |
├── books | |
│ ├── handlers.go | |
│ └── models.go | |
├── config | |
│ └── db.go | |
└── main.go |
process — это объект, позволяющий получить информацию о типе запущенного процесса (рендеринг или основной процесс), версию Chrome и Electron, а также путь до выполняемого js-файла.
Объект File
— это абстракция над нативным File, передающая стандартному HTML5 file API путь к физическому расположению файла в файловой системе пользователя.
package main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"fmt" | |
"crypto/rand" | |
"io" | |
"encoding/base64" | |
"encoding/hex" |
package main | |
import ( | |
"fmt" | |
"gopkg.in/mgo.v2" | |
"gopkg.in/mgo.v2/bson" | |
"time" | |
) | |
type Content struct { |