Skip to content

Instantly share code, notes, and snippets.

View WhiteyDude's full-sized avatar

Whitey WhiteyDude

  • Australia
View GitHub Profile
---
- hosts: all
become: true
become_user: "root"
become_method: sudo
tasks:
- name: Make .ssh directory
file:
path: "/root/.ssh"
state: directory
#!/bin/bash
if [ -z $1 ]; then
echo "Syntax is $0 <port>"
exit 1
fi
if [ -f "/var/run/redis_$1.pid" ]; then
#pid=`cat /var/run/redis_$1.pid`
# kill -15 $pid
redis-cli -p $1 shutdown
fi
[Unit]
Description=Redis Server 6380
After=network.target
[Service]
Type=simple
PIDFile=/var/run/redis_6380.pid
ExecStart=/usr/local/bin/redis-server /etc/redis/6380.conf
ExecStop=/bin/kill -15 $MAINPID
Restart=on-failure
require 'pl.stringx'
stringx.import()
socket = require 'socket'
posix = require 'posix'
function get_number()
return stringx.rjust(tostring(os.date('*t')['sec']) .. tostring(socket.gettime()):split('.',2)[2]:sub(3),4,"0")
end
for i=1,100 do
print(get_number())