Skip to content

Commit 1b9f009

Browse files
owasserm@redhat.comoritwas
authored andcommitted
Ceph scripts
Signed-off-by: [email protected] <[email protected]>
1 parent 0193699 commit 1b9f009

File tree

115 files changed

+3423
-340
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+3423
-340
lines changed

.emacs

+288
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,288 @@
1+
;; -*- mode: emacs-lisp -*-
2+
3+
(require 'xcscope)
4+
(require 'cc-mode)
5+
6+
;; MELPA packages
7+
8+
(require 'package)
9+
(add-to-list 'package-archives
10+
'("melpa" . "http://melpa.org/packages/") t)
11+
(when (< emacs-major-version 24)
12+
;; For important compatibility libraries like cl-lib
13+
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
14+
(package-initialize) ;; You might already have this line
15+
16+
(add-to-list 'package-archives
17+
'("melpa-stable" . "http://stable.melpa.org/packages/") t)
18+
;; set style
19+
20+
(setq-default c-basic-offset 4 c-default-style "linux")
21+
(setq-default tab-width 4 indent-tabs-mode t)
22+
(define-key c-mode-base-map (kbd "RET") 'newline-and-indent)
23+
24+
;; auto repair brackets
25+
;;(require 'autopair)
26+
;;(autopair-global-mode 1)
27+
;;(setq autopair-autowrap t)
28+
29+
;;; yasnippet
30+
;;; should be loaded before auto complete so that they can work together
31+
;;(require 'yasnippet)
32+
;;(yas-global-mode 1)
33+
34+
;;; auto complete mod
35+
;;; should be loaded after yasnippet so that they can work together
36+
(require 'auto-complete-config)
37+
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
38+
(ac-config-default)
39+
;;; set the trigger key so that it can work together with yasnippet on tab key,
40+
;;; if the word exists in yasnippet, pressing tab will cause yasnippet to
41+
;;; activate, otherwise, auto-complete will
42+
(ac-set-trigger-key "TAB")
43+
(ac-set-trigger-key "<tab>")
44+
45+
(require 'ac-clang)
46+
(define-key c++-mode-map (kbd "C-S-<return>") 'ac-complete-clang)
47+
;; replace C-S-<return> with a key binding that you want
48+
49+
; change moving between windows to Shift+{left,up,down,right}
50+
(windmove-default-keybindings)
51+
(setq windmove-wrap-around t)
52+
53+
; Save space
54+
(menu-bar-mode nil)
55+
56+
; Handle .gz files
57+
(auto-compression-mode t)
58+
59+
; Provide templates for new files
60+
(auto-insert-mode t)
61+
62+
;display column number
63+
(column-number-mode 1)
64+
65+
66+
;;(defun my-c-mode-hook ()
67+
;; (setq c-basic-offset 4
68+
;; c-indent-level 4
69+
;; c-default-style "cc-mode"))
70+
;;(add-hook 'c-mode-common-hook 'my-c-mode-hook)
71+
72+
; Allow completions like em-s-region to complete to emacspeak-speak-region
73+
;;(partial-completion-mode)
74+
75+
;; This somehow produced a failure on excelior
76+
;;(add-hook 'after-init-hook 'server-start)
77+
;;(add-hook 'server-done-hook
78+
;; (lambda ()
79+
;; (shell-command "screen -r -X select `cat ~/tmp/emacsclient-caller`");;))
80+
81+
;;(add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p)
82+
83+
;;(unless (featurep 'emacspeak)
84+
;; (add-hook 'emacs-lisp-mode-hook 'eldoc-mode))
85+
86+
; Update string in the first 8 lines looking like Timestamp: <> or " "
87+
;;(add-hook 'write-file-hooks 'time-stamp)
88+
89+
;;; Diary
90+
;(setq diary-file "~/emacs/diary")
91+
;(add-hook 'diary-hook 'appt-make-list)
92+
;(diary 0)
93+
94+
;;; Eshell
95+
;;(eval-after-load "em-term"
96+
;; '(add-to-list 'eshell-visual-commands "zsh"))
97+
98+
;;; Gnus
99+
;;(setq gnus-init-file "~/emacs/.gnus.el")
100+
101+
;;; Abbrevs
102+
; Use C-xaig to correct common typos
103+
(setq abbrev-file-name "~/emacs/abbrev_defs")
104+
(if (file-exists-p abbrev-file-name)
105+
(quietly-read-abbrev-file))
106+
(set-default 'abbrev-mode t)
107+
108+
;; Misc options I just prefer everytime
109+
(setq cperl-indent-level 2
110+
custom-buffer-indent 2
111+
gc-cons-threshold (* 1024 1024)
112+
european-calendar-style t
113+
mail-user-agent 'message-user-agent
114+
message-generate-headers-first t
115+
w3-display-frames 'ask
116+
widget-choice-toggle t
117+
widget-menu-minibuffer-flag t
118+
url-privacy-level '(os agent)
119+
vc-cvs-diff-switches "-u")
120+
121+
122+
(put 'narrow-to-region 'disabled nil)
123+
124+
;;; Crypt++
125+
126+
(require 'crypt++ nil t)
127+
(setq crypt-encryption-type 'mcrypt)
128+
129+
;;; Internet Time
130+
131+
;(add-to-list 'load-path (expand-file-name "~/emacs/lisp/"))
132+
;(require 'itime)
133+
;(setq display-time-string-forms
134+
; '(24-hours ":" minutes " "
135+
; (itime-string 24-hours minutes seconds)
136+
; (if mail
137+
; " Mail"
138+
; ""))
139+
; display-time-interval 30)
140+
;(display-time-mode 1)
141+
142+
143+
;;; Load local configuration
144+
;;(condition-case data
145+
;; (let ((default-directory "~/emacs/"))
146+
;; (load-file "./local"))
147+
;; (file-error 'notfound))
148+
149+
;;; Load Customize
150+
151+
;;(if (file-exists-p
152+
;; (setq custom-file;
153+
;; (concat "~/emacs/custom-"
154+
;; (int-to-string emacs-major-version))))
155+
;; (load-file custom-file))
156+
157+
;;; Semantic
158+
159+
;(unless (featurep 'emacspeak)
160+
; (global-semantic-auto-parse-mode 1)
161+
; (unless (featurep 'emacspeak)
162+
; (setq semantic-auto-parse-no-working-message t))
163+
; (add-hook 'semantic-init-hooks 'senator-minor-mode))
164+
165+
166+
;; Emacs wiki
167+
168+
;;(require 'emacs-wiki)
169+
;;(add-to-list 'emacs-wiki-interwiki-names '("Bug" . "http://bugs.debian.org/"))
170+
;;(add-to-list 'emacs-wiki-interwiki-names '("Package" . "http://packages.debian.org/"))
171+
;;(setq
172+
;; emacs-wiki-projects
173+
;; '(
174+
;; ("PrivateNotes"
175+
;; (emacs-wiki-directories "~/doc/private"))
176+
;; ("DebianWiki"
177+
;; (emacs-wiki-directories "~/debian/notes")
178+
; (emacs-wiki-publishing-directory . "/[su/[email protected]]~/public_html/")
179+
;; (emacs-wiki-publishing-directory . "~/debian/public_html")
180+
;; )))
181+
182+
(when (featurep 'emacspeak)
183+
(defun viavoice-set-language (lang)
184+
(cond
185+
((eq lang 'german)
186+
(dtk-interp-queue "`l4 Deutsch")
187+
(dtk-interp-speak))
188+
((eq lang 'english)
189+
(dtk-interp-queue "`l1 English")
190+
(dtk-interp-speak))
191+
(t (error "Unknown language"))))
192+
(defun emacspeak-set-language-to-german ()
193+
(interactive)
194+
(viavoice-set-language 'german))
195+
(defun emacspeak-set-language-to-english ()
196+
(interactive)
197+
(viavoice-set-language 'english))
198+
(global-set-key (kbd "C-c e") 'emacspeak-set-language-to-english)
199+
(global-set-key (kbd "C-c d") 'emacspeak-set-language-to-german))
200+
201+
(define-prefix-command 'f8-map nil "f7=grep, f8=compile")
202+
(define-key f8-map [f8] 'compile)
203+
(define-key f8-map [f7] 'grep)
204+
(global-set-key [f8] 'f8-map)
205+
(custom-set-variables
206+
;; custom-set-variables was added by Custom.
207+
;; If you edit it by hand, you could mess it up, so be careful.
208+
;; Your init file should contain only one such instance.
209+
;; If there is more than one, they won't work right.
210+
'(column-number-mode t)
211+
'(load-home-init-file t t))
212+
(custom-set-faces
213+
;; custom-set-faces was added by Custom.
214+
;; If you edit it by hand, you could mess it up, so be careful.
215+
;; Your init file should contain only one such instance.
216+
;; If there is more than one, they won't work right.
217+
'(default ((t (:family "DejaVu Sans" :foundry "unknown" :slant normal :weight normal :height 120 :width normal)))))
218+
219+
;;(defun c-lineup-arglist-tabs-only (ignored)
220+
;; "Line up argument lists by tabs, not spaces"
221+
;; (let* ((anchor (c-langelem-pos c-syntactic-element))
222+
;; (column (c-langelem-2nd-pos c-syntactic-element))
223+
;; (offset (- (1+ column) anchor))
224+
;; (steps (floor offset c-basic-offset)))
225+
;; (* (max steps 1)
226+
;; c-basic-offset)))
227+
228+
;; Add kernel style
229+
;;(c-add-style
230+
;; "linux-tabs-only"
231+
;; '("linux" (c-offsets-alist
232+
;; (arglist-cont-nonempty
233+
;; c-lineup-gcc-asm-reg
234+
;; c-lineup-arglist-tabs-only))))
235+
;;(custom-set-variables
236+
;; '(c-default-style "linux-tabs-only")
237+
;;)
238+
239+
'(c-max-one-liner-length 80)
240+
241+
'(fill-column 80)
242+
'(c-ignore-auto-fill (quote (string cpp)))
243+
244+
; cedet semantic
245+
;;(semantic-mode 1)
246+
247+
;;(require 'semantic/ia)
248+
;;(require 'semantic/bovine/gcc)
249+
250+
;;(defun my-semantic-hook ()
251+
;; (imenu-add-to-menubar "TAGS"))
252+
;;(add-hook 'semantic-init-hooks 'my-semantic-hook)
253+
254+
(defun set-frame-size-according-to-resolution ()
255+
(interactive)
256+
(if window-system
257+
(progn
258+
;; use 120 char wide window for largeish displays
259+
;; and smaller 80 column windows for smaller displays
260+
;; pick whatever numbers make sense for you
261+
(if (> (x-display-pixel-width) 1280)
262+
(add-to-list 'default-frame-alist (cons 'width 120))
263+
(add-to-list 'default-frame-alist (cons 'width 80)))
264+
;; for the height, subtract a couple hundred pixels
265+
;; from the screen height (for panels, menubars and
266+
;; whatnot), then divide by the height of a char to
267+
;; get the height we want
268+
(add-to-list 'default-frame-alist
269+
(cons 'height (/ (- (x-display-pixel-height) 200)
270+
(frame-char-height)))))))
271+
272+
(set-frame-size-according-to-resolution)
273+
274+
;;;;;;;;;;
275+
;;; c-mode
276+
(setq c-default-style '((c-mode . "cc-mode")
277+
(java-mode . "java")
278+
(awk-mode . "awk")
279+
(other . "cc-mode")))
280+
281+
(setq-default indent-tabs-mode nil)
282+
;;(setq-default c-default-style "cc-mode")
283+
284+
;;defun my-c-mode-hook ()
285+
;; (setq c-basic-offset 4
286+
;; c-indent-level 4
287+
;; c-default-style "cc-mode"))
288+
;;(add-hook 'c-mode-common-hook 'my-c-mode-hook)

.gitconfig

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[user]
2+
name = Orit Wasserman
3+
4+
[core]
5+
editor = emacs
6+
[alias]
7+
lol = log --graph --decorate --pretty=oneline --abbrev-commit

16309.py

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/usr/bin/env python
2+
import boto
3+
import boto.s3.connection
4+
import os
5+
aws_access_key=os.environ['S3_ACCESS_KEY_ID']
6+
aws_secret_key=os.environ['S3_SECRET_ACCESS_KEY']
7+
bucket_name="bucket1"
8+
port=8000
9+
# Connect to s3.
10+
conn = boto.connect_s3(aws_access_key_id = aws_access_key,
11+
aws_secret_access_key = aws_secret_key,
12+
host = 'localhost',
13+
port = port,
14+
is_secure = False,
15+
calling_format = boto.s3.connection.OrdinaryCallingFormat())
16+
# Create bucket.
17+
bucket = conn.create_bucket(bucket_name)
18+
19+
num_objs = 100
20+
# create object on non versioned bucket
21+
for i in range(1, num_objs):
22+
obj = boto.s3.key.Key(bucket)
23+
obj.key = 'obj'+ `i`
24+
obj.set_contents_from_string('Non versioned')
25+
26+
print bucket
27+
print 'list objects'
28+
for k in bucket.get_all_keys(max_keys = 5):
29+
print k
30+
for version in bucket.list_versions():
31+
print version.name + ' id ' + version.version_id
32+
33+
# Turn on versioning for this bucket.
34+
bucket.configure_versioning(True)
35+
36+
print bucket
37+
print 'list object versioning on '
38+
for k in bucket.get_all_keys(max_keys=5):
39+
print k
40+
for version in bucket.list_versions():
41+
print version.name + ' id ' + version.version_id
42+

17040.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
TOKEN=0555b35654ad1656d804
2+
BUCKET=cont
3+
publicURL=http://127.0.0.1:8000
4+
5+
#getting token
6+
#curl -D - -H "X-Auth-User: tester1:tester1" -H "X-Auth-Key: asdf" ${publicURL}/auth
7+
8+
token=AUTH_rgwtk0f000000746573746572313a74657374657231358a5852f43e7de8d73f89553cd3551ef377a4c0e716592d1d852e51125b170fbc55f0da
9+
10+
bucket='evgeny-test'
11+
12+
python ~/scripts/create_swift_bucket.py --name $bucket
13+
swift -A $publicURL/auth/1.0 -U tester1:tester1 -K 'asdf' upload $bucket /tmp/456 /tmp/456
14+

0 commit comments

Comments
 (0)