In [4]:
%colors Linux
In [7]:
%history
In [6]:
%dirs
Out[6]:
In [8]:
%magic
In [9]:
%pwd
Out[9]:
In [10]:
%quickref
Had an issue with my keyboard where a few keys were sticking, worn, and they weren't detected or showed up twice. Constant password auth failures so a quick Google search returned the following results:
1) Change Password Entry To Show * (asterix) instead of no feed back - less secure!
#run command
sudo visudo
#change
Defaults env_reset
#to
Defaults env_reset,pwfeedback
2) Change from VI to Nano or Emacs etc..
export VISUAL=nano; visudo
Check out clean repo:
git clone --bare https://github.com/[user]/[repo].git
cd [repo].git
create git-author-rewrite.sh file:
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_AUTHOR_NAME="$CORRECT_NAME"
export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
fi
' --tag-name-filter cat -- --branches --tags
make executable:
chmod +x create git-author-rewrite.sh
review changes:
git log
push changes:
git push --force --tags origin 'refs/heads/*'
cleanup:
cd ..
rm -rf [repo].git
(Managing Remotes Documentation)[https://git-scm.com/book/ch2-5.html]
(Multiple push remotes)[http://stackoverflow.com/questions/14290113/git-pushing-code-to-two-remotes]
Show current remotes:
git remote -v
Add a "all" remote
git remote add all git://original/repo.git
git remote -v
Add another repo to the remote
git remote set-url --add --push all git://another/repo.git
This will replace you orignal push, so simply add it back in
git remote set-url --add --push all git://original/repo.git
Now you should see both pushes
git remote -v
In [5]:
print "this is a test of the emergency broadcast system"
In [11]:
%%html
<style>
html {
font-size: 62.5% !important; }
body {
font-size: 1.5em !important; /* currently ems cause chrome bug misinterpreting rems on body element */
line-height: 1.6 !important;
font-weight: 400 !important;
font-family: "Raleway", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
color: #222 !important; }
div{ border-radius: 0px !important; }
div.CodeMirror-sizer{ background: rgb(244, 244, 248) !important; }
div.input_area{ background: rgb(244, 244, 248) !important; }
div.out_prompt_overlay:hover{ background: rgb(244, 244, 248) !important; }
div.input_prompt:hover{ background: rgb(244, 244, 248) !important; }
h1, h2, h3, h4, h5, h6 {
color: #333 !important;
margin-top: 0 !important;
margin-bottom: 2rem !important;
font-weight: 300 !important; }
h1 { font-size: 4.0rem !important; line-height: 1.2 !important; letter-spacing: -.1rem !important;}
h2 { font-size: 3.6rem !important; line-height: 1.25 !important; letter-spacing: -.1rem !important; }
h3 { font-size: 3.0rem !important; line-height: 1.3 !important; letter-spacing: -.1rem !important; }
h4 { font-size: 2.4rem !important; line-height: 1.35 !important; letter-spacing: -.08rem !important; }
h5 { font-size: 1.8rem !important; line-height: 1.5 !important; letter-spacing: -.05rem !important; }
h6 { font-size: 1.5rem !important; line-height: 1.6 !important; letter-spacing: 0 !important; }
@media (min-width: 550px) {
h1 { font-size: 5.0rem !important; }
h2 { font-size: 4.2rem !important; }
h3 { font-size: 3.6rem !important; }
h4 { font-size: 3.0rem !important; }
h5 { font-size: 2.4rem !important; }
h6 { font-size: 1.5rem !important; }
}
p {
margin-top: 0 !important; }
a {
color: #1EAEDB !important; }
a:hover {
color: #0FA0CE !important; }
code {
padding: .2rem .5rem !important;
margin: 0 .2rem !important;
font-size: 90% !important;
white-space: nowrap !important;
background: #F1F1F1 !important;
border: 1px solid #E1E1E1 !important;
border-radius: 4px !important; }
pre > code {
display: block !important;
padding: 1rem 1.5rem !important;
white-space: pre !important; }
button{ border-radius: 0px !important; }
.navbar-inner{ background-image: none !important; }
select, textarea{ border-radius: 0px !important; }
</style>
Obtain Active window using Python
Corected code is now here
"import wnck" only works with python 2.x, using python3.x pypie and wx were the only options I found so far
In [18]:
import sys
import os
from subprocess import PIPE, Popen
import re
def get_active_window_title():
root = Popen(['xprop', '-root', '_NET_ACTIVE_WINDOW'], stdout=PIPE)
for line in root.stdout:
m = re.search(b'^_NET_ACTIVE_WINDOW.* ([\w]+)$', line)
if m != None:
id_ = m.group(1)
id_w = Popen(['xprop', '-id', id_, 'WM_NAME'], stdout=PIPE)
break
if id_w != None:
for line in id_w.stdout:
match = re.match(b"WM_NAME\(\w+\) = (?P<name>.+)$", line)
if match != None:
return match.group("name")
return "Active window not found"
In [19]:
get_active_window_title()
Out[19]:
In [23]:
import time
time.sleep(2)
get_active_window_title()
Out[23]:
In [ ]: