-
Notifications
You must be signed in to change notification settings - Fork 0
/
fairfieldlogin.py
196 lines (116 loc) · 3.34 KB
/
fairfieldlogin.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <markdowncell>
# <h1>Fairfield Login</h1>
#
# This is a script that deals with managing a internet cafe.
#
# I need to make it easy to create users, assign time to users, remove time, ban users, reset passwords, give time to a group of users (users who read, help garden etc.
#
# Manages when computers are turned on and off.
# Computers turn on at 7:50am everymorning and perform a update, sync from origin.
# Allows Public login, allowed to login as users.
# At 2.25 computers reset and public is disabled.
#
# Give 45 mins to everybody. Add for bonus.
#
#
# All the ipynb files in a folder.
# script opens ipynb filename striping the .ipynb add .meta instead. Opens the .meta and saves filename title, slug, time year-month-day-hour-min.
#
#
# <codecell>
import os
# <codecell>
os.getuid()
# <codecell>
os.getgroups()
# <codecell>
#os.system('rsync -azP /home/wcmckee/motion/ wcmckee@getsdrawn.com:/home/wcmckee/motion/')
# <codecell>
opfair = os.listdir('/home/wcmckee/ipy/wcmckee-ipython/posts')
# <codecell>
namfil = []
# <codecell>
opfair
# <markdowncell>
# If space in the filename then change to - for url-friendly.
# <codecell>
opsrip = []
# <codecell>
os.system('rm -rf /home/wcmckee/fairfieldcode/posts/*.meta')
# <codecell>
spliz = []
# <codecell>
saost = os.stat('/home/wcmckee/fairfieldcode/posts')
# <codecell>
saost.st_mtime
# <codecell>
saost.st_mtime
# <codecell>
saost.st_size
# <codecell>
saost.st_uid
# <codecell>
saost.st_atime
# <codecell>
saost.st_atime
# <codecell>
oswa = os.walk('/home/wcmckee')
# <codecell>
os.sysconf('SC_2_CHAR_TERM')
# <codecell>
os.sysconf_names
# <codecell>
os.listdir('/home/wcmckee/fairfieldcode/posts/')
for ipos in os.listdir('/home/wcmckee/fairfieldcode/posts/'):
print ipos
spliz.append([os.path.splitext(' ')[0] for x in ipos])
# <codecell>
spliz
# <codecell>
for opfa in opfair:
#opfa.replace(" ", "")
print opfa
#[os.path.splitext(x)[0] for x in a]
opsrip.append(opfa.strip('.ipynb'))
print opfa.strip('.ipynb')
# if (' ') in opfa.strip('.ipynb'):
# print opfa.strip('.ipython')
# <codecell>
os.chdir('/home/wcmckee/fairfieldcode/posts/')
# <codecell>
import time
# <codecell>
endate = time.strftime("%d" + "-" + "%b" + "-" + "%Y" + "-")
#print time.strftime(("%d" + "-" + "%b" + "-" + "%Y"))
entim = time.strftime("%H:%M")
# <codecell>
endate
# <codecell>
for opfilz in opsrip:
print opfilz
with open(str(opfilz) + '.meta', "w") as f:
rstrin = opfilz.encode('ascii', 'ignore').decode('ascii')
#print matdict
#metadict = dict()
#for lisz in lisrgc:
# metadict.update({'up': lisz.ups})
# metadict.update({'down': lisz.downs})
# metadict.update({'title': lisz.title})
# metadict.update({'created': lisz.created})
f.write(rstrin.strip(' ') + '\n' + rstrin + '\n' + endate + entim)
# <codecell>
import nikola
# <codecell>
os.chdir('/home/wcmckee/fairfieldcode/')
# <codecell>
os.system('nikola build')
# <codecell>
os.system('rsync -azP /home/wcmckee/fairfieldcode wcmckee@wcmckee.com:/home/wcmckee/fairfieldcode/')
# <codecell>
opconf = open('/home/wcmckee/fairfieldcode/conf.py', 'r')
# <codecell>
opconf.read()
# <codecell>
# <codecell>