看来 jQuery 你已经用得很爽了,想学习如何自己编写插件。非常好,这篇文档正适合你。用插件和方法来扩展 jQuery 非常强大,把最聪明的功能封装到插件中可以为你及团队节省大量开发时间。
#!/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 |
// CopyFile copies the contents of the file named src to the file named | |
// by dst. The file will be created if it does not already exist. If the | |
// destination file exists, all it's contents will be replaced by the contents | |
// of the source file. The file mode will be copied from the source and | |
// the copied data is synced/flushed to stable storage. | |
func CopyFile(src, dst string) (err error) { | |
in, err := os.Open(src) | |
if err != nil { | |
return |
Moved to git repository: https://github.com/denji/jetbrains-cleanup-backup
Quick uninstall
JetBrains settings:
curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-uninstall.sh | bash -s
Quick backup
JetBrains settings:
curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-backup.sh | bash -s
// getMacAddr gets the MAC hardware | |
// address of the host machine | |
func getMacAddr() (addr string) { | |
interfaces, err := net.Interfaces() | |
if err == nil { | |
for _, i := range interfaces { | |
if i.Flags&net.FlagUp != 0 && bytes.Compare(i.HardwareAddr, nil) != 0 { | |
// Don't use random as we have a real address | |
addr = i.HardwareAddr.String() | |
break |
tmux is a "terminal multiplexer", it enables a number of terminals to be accessed and controlled from a single terminal. | |
If you use Debian/Ubuntu, you can just run apt-get install tmux, and voila. | |
Since the title was about centos 7, then do the following step to install tmux. | |
(1). tmux has a library dependency on libevent which, of course, isn’t installed by default. | |
$ wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
$ tar xzvf libevent-2.0.21-stable.tar.gz | |
$ cd libevent-2.0.21-stable |
# author: Bluefissure | |
# License: MIT License | |
# Description: Fixes Palworld brokwn save files corrupted by someone existing the guild | |
# Based on the work of https://github.com/cheahjs/palworld-save-tools/releases/tag/v0.13.0 | |
import argparse | |
import codecs | |
import os | |
import json | |
from lib.gvas import GvasFile |
Gitlab enforced token expiry limits to 365 days last year, and the time is now upon us.
They don't have an opt-out for this, and haven't provided a way to easily extend tokens in the web interface. They have also gated their credential management interface behind their Ultimate license.
This quickly thrown together script will allow you to add an extra year to all tokens that expire in the next 30 days. It will not reactivate tokens that have already expired.
Requires the python-gitlab module. Edit your self-hosted Gitlab instance details into the script and run it. It will dump out CSVs of all expiring tokens, and then dump out a list of commands you can paste into a gitlab-rails console
session to extend the expiry date by another year. If you need them to be active for longer, change 1.year.from_now
to the value of your choice, e.g. `10.years.fro