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
# Use LF EOLs, not CRLFs, or backup folder might get CR in its name. | |
rsync --timeout=60 -aP --append-verify --stats user@host:/folder /cygdrive/f/backup | |
echo Done `date` |
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
""" Steam auto-away while idle. 2016-02-07 v1.0 by Cees Timmerman """ | |
import ctypes, subprocess, time | |
class LASTINPUTINFO(ctypes.Structure): # https://msdn.microsoft.com/en-us/library/windows/desktop/ms646272%28v=vs.85%29.aspx | |
_fields_ = [('cbSize', ctypes.c_uint), | |
('dwTime', ctypes.c_ulong)] # DWORD | |
lii = LASTINPUTINFO() | |
lii.cbSize = ctypes.sizeof(lii) |
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
Function example(ByVal r As Range, r2) As String | |
' Functioning practical Excel example by Cees.Timmerman@company. | |
' 2016-01-19 v1.0 | |
' Sample usage: Press Alt+F11, Tools, Macros..., "example", Create, and replace template code. | |
' Make A1 "1;2;3" and B2 "=example(A1;A2)" or "=example(A1,A2)" if second parameter doesn't turn green. | |
' B2 should now have value "03". Press Ctrl+Alt+F9 to update all function cells after editing the function. | |
On Error GoTo ErrorHandler | |
Debug.Print "When debugging, this appears in the Immediate Window. It is now " & Now() | |
Debug.Print "r is " & r.NumberFormat _ | |
& " " & TypeName(r) _ |
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
# synchronous | |
a = 'abc'; for i in [0...a.length] then console.log i, a[i] | |
# asynchronous | |
a = 'abc'; i = 0; x = setInterval -> | |
if i < a.length then console.log i, a[i]; ++i else clearInterval x | |
, 1000 |
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
"C:\Program Files\MongoDB\Server\3.0\bin\mongodump.exe" /h cluster.mongolab.com:port /d dbname /u user /p pass | |
2016-02-25T17:15:09.639+0100 writing dbname.system.indexes to dump\dbname\system.indexes.bson | |
2016-02-25T17:15:09.642+0100 writing dbname.objectlabs-system to dump\dbname\objectlabs-system.bson | |
2016-02-25T17:15:09.645+0100 writing dbname.houston_admins to dump\dbname\houston_admins.bson | |
2016-02-25T17:15:09.646+0100 writing dbname.assets to dump\dbname\assets.bson | |
2016-02-25T17:15:09.756+0100 writing dbname.users to dump\dbname\users.bson | |
2016-02-25T17:15:09.761+0100 writing dbname.objectlabs-system metadata to dump\dbname\objectlabs-system.metadata.json | |
2016-02-25T17:15:09.918+0100 writing dbname.users metadata to dump\dbname\users.metadata.json | |
2016-02-25T17:15:09.920+0100 writing dbname.houston_admins metadata to dump\dbname\houston_admins.metadata.json | |
2016-02-25T17:15:09.959+0100 done dumping dbname.objectlabs-system (1 document) |
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
show create table orders_products; | |
ALTER TABLE orders_products DROP FOREIGN KEY orders_products_ibfk_1; | |
alter table orders_products modify column orderId bigint; | |
alter table orders modify column id bigint AUTO_INCREMENT; | |
ALTER TABLE orders_products ADD CONSTRAINT `orders_products_ibfk_1` FOREIGN KEY (`orderId`) REFERENCES `orders` (`id`); |
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
netsh interface ipv4 set address "Local Area Connection" static 10.0.0.2 255.0.0.0 10.0.0.1 | |
netsh interface ipv4 add dnsserver "Local Area Connection" address=8.8.8.8 index=1 | |
netsh interface ipv4 add dnsserver "Local Area Connection" address=8.8.4.4 index=2 | |
pause |
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
<NotepadPlus> | |
<UserLang name="CoffeeScript" ext="coffee" udlVersion="2.1"> | |
<Settings> | |
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" /> | |
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="yes" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" /> | |
</Settings> | |
<KeywordLists> | |
<Keywords name="Comments">03### 04### 00# 01 02</Keywords> | |
<Keywords name="Numbers, prefix1"></Keywords> | |
<Keywords name="Numbers, prefix2"></Keywords> |
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
#!/bin/bash | |
dircolors -p > ~/.dircolors | |
sed -i "s/RESET 0 /RESET 00;30;47 /" ~/.dircolors | |
eval `dircolors ~/.dircolors` | |
echo eval \`dircolors ~/.dircolors\` >> ~/.bashrc |
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/perl | |
use Mysql; | |
use strict; | |
use vars qw($school_name); | |
use vars qw($pass); | |
require "./cgi-lib.pl"; |