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 | |
#if emacs is running focus emacs | |
#else run emacs | |
if [ $(wmctrl -l | grep XXX--Emacs--XXX | awk '{ print $4 }') == XXX--Emacs--XXX ]; then | |
#you should put this line to your init.el or .emacs file | |
#(setq frame-title-format "XXX--Emacs--XXX") | |
wmctrl -a XXX--Emacs--XXX |
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
(defun TurengSearch () | |
"Tureng search" | |
(interactive) | |
(browse-url | |
(concat | |
"http://tureng.com/en/turkish-english/" | |
(url-hexify-string (if mark-active | |
(buffer-substring (region-beginning) (region-end)) | |
(read-string "Search Tureng: ")))))) |
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 | |
# Small script that works on GNOME as OCR to text | |
# Install | |
# sudo apt-get install tesseract-ocr | |
# sudo apt-get install xsel | |
# Usage | |
# Bound shortcut(Ctrl-Alt-Z) from GNOME settings |
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
<TaskerData sr="" dvi="1" tv="4.8u1"> | |
<Task sr="task18"> | |
<cdate>1369143331769</cdate> | |
<edate>1454785550311</edate> | |
<id>18</id> | |
<nme>Say Today Tasks</nme> | |
<pri>100</pri> | |
<Action sr="act0" ve="7"> | |
<code>547</code> | |
<Str sr="arg0" ve="3">%newline1</Str> |
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 | |
# Copied from http://askubuntu.com/questions/269574/wmctrl-focus-most-recent-window-of-an-app | |
# Usage | |
# Download wmctrl by using apt-get or yum | |
# Bound shortcut that sh code from your environment | |
# If you press more than one it will change windows | |
app_name=APPNAME | |
workspace_number=`wmctrl -d | grep '\*' | cut -d' ' -f 1` |
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
- name: Check is rvm installed | |
shell: command -v rvm >/dev/null 2>&1 | |
register: is_rvm_exist | |
ignore_errors: yes | |
- debug: msg="{{ is_rvm_exist.rc }}" # it returns rc 1 | |
- debug: var=is_rvm_exist | |
- name: Check is ls installed | |
shell: command -v ls >/dev/null 2>&1 |
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
# Shows all volumes of any environment | |
REGION='us-east-1' | |
VOLUMES=$(aws ec2 describe-instances --region=$REGION --query 'Reservations[*].Instances[*].BlockDeviceMappings[*].Ebs' --filter "Name=tag:Environment,Values=Uat" --output text | awk '{print($4)}') | |
echo "Your volumes $VOLUMES" | |
for VOLUME in $VOLUMES |
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
; I don't know where I stole it but it works well | |
(defun open-terminal-pop-project-root () | |
(interactive) | |
(do-applescript | |
(format " | |
tell application \"iTerm 2\" | |
tell current window | |
tell current session | |
write text \"cd %s\" | |
end tell |
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
;; Few changes to https://github.com/abo-abo/hydra/wiki/Git-gutter | |
(defhydra hydra-git-gutter (:body-pre | |
(save-buffer) | |
(git-gutter-mode 1) | |
:hint nil | |
:color blue) | |
" | |
Git gutter: | |
_n_: next hunk _s_tage hunk _u_ndo _r_edo _q_uit | |
_p_: previous hunk _R_evert hunk ^ ^ _Q_uit and deactivate git-gutter |
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
# Example which shows how to reach nested ansible variable which is partially different. | |
# Run that plabook with ansible-playbook -e "env=test" ansible-nested-variable.yml | |
--- | |
# | |
- hosts: localhost | |
connection : ssh | |
gather_facts: no | |
vars: | |
cidr_blocks: | |
vpc_production_cidr_block: "10.10.0.0/28" |
OlderNewer