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
gitlab-rails console production | |
user = User.create(:username=>'root',:password=>'xXxXx',:password_confirmation=>'',:email=>'[email protected]',:name=>'root') | |
user.save! |
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
$ rbd info vm-XXX-disk-1 | |
rbd image 'rbdbigsize': | |
size 1862 PB in 500000000000 objects | |
order 22 (4096 kB objects) | |
block_name_prefix: rbd_data.047aa74b0dc51 | |
format: 1 | |
$ rados -p cph rm rbd_id.vm-XXX-disk-1 | |
$ rados -p cph rm rbd_header.047aa74b0dc51 |
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/env python3 | |
""" | |
Class for scalable client which runs workers in threads | |
""" | |
# | |
import random | |
import threading | |
import time | |
# | |
# |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
body { | |
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | |
margin: auto; | |
position: relative; | |
width: 960px; | |
} |
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
with open( filePath ) as infile: | |
""" | |
# read first line and remember it | |
first_line = infile.readline() | |
# or only skip first line | |
next( infile ) | |
""" | |
for line in infile: | |
print line |
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 getTrilateration(position1, position2, position3) { | |
var xa = position1.x; | |
var ya = position1.y; | |
var xb = position2.x; | |
var yb = position2.y; | |
var xc = position3.x; | |
var yc = position3.y; | |
var ra = position1.distance; | |
var rb = position2.distance; | |
var rc = position3.distance; |
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 su - zimbra | |
# list all accounts and print out account name and aliases | |
for i in `zmprov -l gaa` ; do zmprov ga $i zimbraMailAlias ; done | |
# list all distribution lists and any members and/or aliases | |
for i in `zmprov gadl` ; do zmprov gdl $i zimbraMailAlias zimbraMailForwardingAddress ; done |
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
Install on both hosts: | |
```apt-get install bluez-compat``` | |
Enter: ```modprobe bnep``` on both nodes. Then enter: | |
on server: | |
```pand --listen --role GN``` | |
on client: |
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/env python | |
# | |
# Very basic example of using Python and IMAP to iterate over emails in a | |
# gmail folder/label. This code is released into the public domain. | |
# | |
# RKI July 2013 | |
# http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/ | |
# | |
import sys | |
import imaplib |
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/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Generates CSV file for Apple-ID-AppleScript | |
# https://github.com/aaronfreimark/Apple-ID-AppleScript | |
# | |
# Dariusz Pawlak <[email protected]> | |
# 2014.09.15 | |
# | |
# According to http://stackoverflow.com/questions/10748453/replace-comma-with-newline-in-sed |
NewerOlder