start new:
tmux
start new with session name:
tmux new -s myname
/** | |
* MongoDB query to delete outdated files from Rocket.Chat. You can specify the number of DAYS | |
* before a file is considered outdated. Deleted files are removed from GridFS completely keeping | |
* only the message in chat. The message is modified to be a link that points to ALT_LINK instead | |
* of the file and '(deleted)' is appended to the title. | |
* | |
* Tested with MongoDB 3.4 | |
*/ | |
const DAYS = 60; |
Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.
sudo apt remove openssh-server
sudo apt install openssh-server
/etc/ssh/sshd_config
file by running the command sudo vi /etc/ssh/sshd_config
and do the following
Port
to 2222 (or any other port above 1000)UsePrivilegeSeparation
to no<!--- In a ui page --> | |
<!-- this will get the token on the server side and set it to a client-side javascript variable. | |
<g:evaluate object="true"> | |
var g_ck = gs.getSessionToken(); | |
</g:evaluate> | |
<script> | |
window.g_ck = "$[g_ck]"; | |
</script> | |
<!-- In your AngularJS config, you can set the token as a default $httpProvider header --> |
package main | |
import ( | |
"bytes" | |
"encoding/hex" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net" |
#!/bin/bash | |
#title : replication-start.sh | |
#description : This script automates the process of starting a Mysql Replication on 1 master node and N slave nodes. | |
#author : Nicolas Di Tullio | |
#date : 20160706 | |
#version : 0.2 | |
#usage : bash mysql_replication_autostart.sh | |
#bash_version : 4.3.11(1)-release | |
#============================================================================= |
apt-get install build-essential cmake -y
cmake \
-DWITH_BOOST=/usr/local/src/mysql-5.7.19/boost/boost_1_59_0 \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql57 \
#!/bin/bash | |
mysqlbinlog56=/store/mysql-5.6.23-linux-glibc2.5-x86_64/bin/mysqlbinlog | |
mysqlclient=/store/mysql-5.6.23-linux-glibc2.5-x86_64/bin/mysql | |
pidfile=/var/run/binlogstream.pid | |
binlogdir=/store/binlogstreamer/binlogs | |
binlogprefix=mysql-bin | |
mysqluser=tester | |
mysqlpass=tester | |
mysqlmaster=10.72.100.236 |
$ uname -r