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
wget --content-disposition https://nct.onlyoffice.com/sh/Xsy # Hello world image | |
wget http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-1.el7_6.noarch.rpm | |
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-19.03.5-3.el7.x86_64.rpm | |
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-cli-19.03.5-3.el7.x86_64.rpm | |
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-selinux-17.03.3.ce-1.el7.noarch.rpm | |
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm | |
sudo rpm -i container-selinux-2.107-1.el7_6.noarch.rpm | |
sudo rpm -i docker-ce-19.03.5-3.el7.x86_64.rpm docker-ce-cli-19.03.5-3.el7.x86_64.rpm docker-ce-selinux-17.03.3.ce-1.el7.noarch.rpm containerd.io-1.2.6-3.3.el7.x86_64.rpm | |
sudo systemctl start docker |
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
[loggers] | |
keys=root,sampleLogger | |
[handlers] | |
keys=consoleHandler | |
[formatters] | |
keys=sampleFormatter | |
[logger_root] |
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
sudo yum -y update | |
sudo yum -y groupinstall "Development Tools" | |
sudo yum -y install openssl-devel bzip2-devel libffi-devel | |
wget https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz | |
tar xvf Python-3.8.5.tgz | |
cd Python-3.8.5 | |
./configure --with-ssl | |
make & make altinstall | |
ln -s /usr/local/bin/pip3.8 /usr/bin/pip3 | |
ln -s /usr/local/bin/python3.8 /usr/bin/python3 |
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
git rm -rf --cached . | |
git add . | |
git commit -m ".gitignore caching" | |
push |
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
vi /etc/environment | |
add these lines... | |
LANG=en_US.utf-8 | |
LC_ALL=en_US.utf-8 |
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
systemctl stop mysqld / systemctl stop mariadb | |
service mysqld stop / service mariadb stop | |
mysqld --skip-grant-tables --user=root & | |
> mysql | |
FLUSH PRIVILEGES; | |
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root_passowrd'; | |
exit |
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
db.audit.remove({"reqTime" : { $lt : new Date('01/01/2016').getTime()}}) #remove everything is older than (bad performance) | |
db.audit.find().sort({"createdAt" : -1}).limit(1) #get latest created | |
db.collection.stats() #info about collection | |
export collection mongo in cvs file | |
mongoexport -h host -d dbname -c collectionname --type=csv -f name,side,type,field --out ~/export20160426.csv | |
db.fs.files.aggregate([{$group: {_id: "$contentType", total : { $sum: 1 }}}]) # count type on FS Grid |
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
curl 'localhost:9200/_cat/indices?v' => list of index | |
curl 'localhost:9200/_cluster/health?pretty' => health | |
curl -XGET 'http://localhost:9200/_mapping/twitter' => map of index twitter | |
curl -XPOST 'localhost:9200/bank/_search?pretty' -d ' | |
{ | |
"size": 0, | |
"aggs": { |
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
# first make sure that the virtual machine is running | |
docker-machine start dev | |
Set environment variables to dictate that docker should run a command against a particular machine: | |
$ eval "$(docker-machine env dev)" | |
Check if environment is set: | |
$ env | grep DOCKER | |
DOCKER_HOST=tcp://192.168.99.100:2376 | |
DOCKER_CERT_PATH=/Users/dm/.docker/machines/.client | |
DOCKER_TLS_VERIFY=1 |
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
get add contains next remove(0) iterator.remove | |
ArrayList O(1) O(1) O(n) O(1) O(n) O(n) | |
LinkedList O(n) O(1) O(n) O(1) O(1) O(1) | |
CopyOnWrite-ArrayList O(1) O(n) O(n) O(1) O(n) O(n) | |
add contains next notes | |
HashSet O(1) O(1) O(h/n) h is the table capacity | |
LinkedHashSet O(1) O(1) O(1) | |
CopyOnWriteArraySet O(n) O(n) O(1) | |
EnumSet O(1) O(1) O(1) |
NewerOlder