This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
example delimiters : [ !,?._'@] (including space) | |
*/ | |
String[] tokens = s.replaceFirst("^[ !,?._'@]+", "").split("[ !,?._'@]+"); | |
// to keep leading empty string | |
String[] tokens = s.split("[ !,?._'@]+"); | |
// to keep trailing empty string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# assume : | |
# - openproject installed in /opt/openproject | |
# - local port: 6000 | |
# - external port: 6020 | |
server { | |
listen 6020; | |
server_name SERVER_DOMAIN_NAME; | |
root /opt/openproject/public; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# applied when back up through 'sudo openproject run backup' not working due to access denied 1045 issue | |
# using mysqldump instead. be sure to replace 'BACKUP_PATH/backup.sql' with desired baclup file location. | |
sudo mysqldump --single-transaction --add-drop-table --add-locks --result-file=BACKUP_PATH/backup.sql --host=localhost --user=openproject --password openproject | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import base64 | |
from Crypto import Random | |
from Crypto.Cipher import AES | |
import hashlib | |
BS = 16 | |
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS) |
NewerOlder