This file contains hidden or 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
-- http://stackoverflow.com/questions/6267273/how-to-restore-to-a-different-database-in-sql-server | |
-- https://github.com/Microsoft/sql-server-samples/releases | |
RESTORE FILELISTONLY FROM DISK='/var/opt/mssql/backup/AdventureWorks2012.bak' | |
-- Note the logical file names from the Results pane | |
RESTORE DATABASE AdventureWorks2012 FROM DISK='/var/opt/mssql/backup/AdventureWorks2012.bak' | |
WITH | |
MOVE 'AdventureWorks2012' TO '/var/opt/mssql/data/AdventureWorks2012.mdf', | |
MOVE 'AdventureWorks2012_log' TO '/var/opt/mssql/data/AdventureWorks2012_log.ldf' | |
-- Make the new database name different than the filename specified to attach |
This file contains hidden or 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
process.stdin.resume(); | |
process.stdin.setEncoding('ascii'); | |
var input_stdin = ""; | |
var input_stdin_array = ""; | |
var input_currentline = 0; | |
process.stdin.on('data', function (data) { | |
input_stdin += data; | |
}); |
This file contains hidden or 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
RUN apt-get install -y openssh-server | |
RUN mkdir /var/run/sshd | |
RUN echo 'root:root' |chpasswd | |
RUN sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config | |
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config | |
CMD ["/usr/sbin/sshd", "-D"] |
This file contains hidden or 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
// Variables | |
$default-font-color: rgb(119, 119, 119); | |
$rem-cal-background: rgba(232, 232, 232, 1); | |
.rem-cal { | |
position: relative; | |
.rem-cal-wrapper { | |
position: relative; | |
display: none; | |
z-index: 10; |
This file contains hidden or 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
function getStartDate(d, bwd) { | |
var dt = d.getDate(); | |
var m = d.getMonth() - 1; | |
var y = d.getFullYear(); | |
if(m < 0) { | |
m = 11; | |
y -= 1; | |
} | |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>CodeRuse</title> | |
<link rel='shortcut icon' href='./favicon.ico' type='image/x-icon'> | |
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400" rel="stylesheet"> | |
<style> | |
body { |
This file contains hidden or 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
# http://unix.stackexchange.com/questions/65595/how-to-know-if-a-disk-is-an-ssd-or-an-hdd | |
# http://serverfault.com/questions/551453/how-do-i-verify-that-my-hosting-provider-gave-me-ssds | |
# if on a bare server, 1 for rotating disk, 0 for SSD | |
# cat /sys/block/sda/queue/rotational | |
# if on a vps, this script should be finished in less than one second for SSD | |
time for i in `seq 1 1000`; do | |
dd bs=4k if=/dev/sda count=1 skip=$(( $RANDOM * 128 )) >/dev/null 2>&1; | |
done |
This file contains hidden or 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
var a = 'name', b; | |
console.log(a + b); | |
console.log(a + b, function () { | |
return a; | |
}, a / b); | |
console.log(a + + ': '); | |
console.log('Hello, ' + 'World!!!'); | |
console.log('Hello, ' + + 'World!!!'); | |
console.log('Hello, ' + 'World!!!' + + ''); | |
console.log(typeof undefined); |
This file contains hidden or 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
# Install youtube-dl | |
apt-get remove youtube-dl | |
apt-add-repository ppa:nilarimogard/webupd8 | |
apt-get update | |
apt-get install youtube-dl | |
# Update avconv | |
add-apt-repository ppa:heyarje/libav-11 && apt-get update |
This file contains hidden or 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
#!/bin/bash | |
# Cloud-config for CoreOS IPXE deployment on Vultr | |
################################################## | |
# This cloud-config bootstraps CoreOS on /dev/vda and provisions: | |
# - private ip-address on eth1 | |
# - etcd on private network | |
# - fleet on private network | |
# - basic firewall (docker compatible) | |
# - SSHd security hardening | |
################################################## |