2 커밋 c36b3c51ff ... abf2d772ae

작성자 SHA1 메시지 날짜
  koreymacdougall abf2d772ae Various additions 3 년 전
  koreymacdougall 78579fa383 Various updates 3 년 전
9개의 변경된 파일191개의 추가작업 그리고 30개의 파일을 삭제
  1. 21 3
      emacs/.emacs
  2. 43 10
      emacs/.emacs~
  3. 16 1
      emacs/initial_notes.org
  4. 18 10
      i3/i3_config
  5. 35 1
      notes/cheatsheet.md
  6. 32 0
      vim/UltiSnips/html.snippets
  7. 9 1
      vim/mappings.vim
  8. 13 3
      vim/plug.vim
  9. 4 1
      vim/settings.vim

+ 21 - 3
emacs/.emacs

@@ -18,6 +18,15 @@
 (require 'bind-key)
 (setq use-package-always-ensure t)
 
+;; enable time tracking in org-mode
+(setq org-clock-persist 'history)
+(org-clock-persistence-insinuate)
+
+(use-package ivy :demand
+  :config
+  (setq ivy-use-virtual-buffers t
+	ivy-count-format "%d/%d "))
+(ivy-mode 1)
 
 ;; (desktop-save-mode 1)
 ;; this will ensure that packages are always installed if not present
@@ -84,11 +93,20 @@
 ;;(setq package-enable-at-startup nil)
 (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
 
-;; Org Mode Settings
+;; org-mode Settings
 ;; set up an agenda keybind
 (use-package org
   :config
-  (setq org-ellipsis "  ▼"))
+  (setq org-ellipsis "  ▼")
+  ;; set image width for inline images to nil, so they can be resized inline
+  (setq org-image-actual-width nil)
+  ;; make boldface font show red (useful for important/urgent)
+  (add-to-list 'org-emphasis-alist
+             '("*" (:foreground "red")
+               ))
+  )
+
+
 
 (global-set-key (kbd "C-c a") 'org-agenda)
 ;; enable org-bullet-mode, replace asterisks with bullets
@@ -217,7 +235,7 @@
  '(org-agenda-files (quote ("~/TODO.org")))
  '(package-selected-packages
    (quote
-    (projectile evil-collection markdown-mode ivy-avy org-bullets doom-themes all-the-icons-ivy all-the-icons-gnus doom-modeline zenburn-theme lorem-ipsum ## powerline use-package evil-commentary undo-fu undo-tree evil notmuch)))
+    (zetteldeft exwm-surf zprint-format darkroom projectile evil-collection markdown-mode ivy-avy org-bullets doom-themes all-the-icons-ivy all-the-icons-gnus doom-modeline zenburn-theme lorem-ipsum ## powerline use-package evil-commentary undo-fu undo-tree evil notmuch)))
  '(pdf-view-midnight-colors (cons "#EEFFFF" "#292D3E"))
  '(rustic-ansi-faces
    ["#292D3E" "#ff5370" "#c3e88d" "#ffcb6b" "#82aaff" "#c792ea" "#89DDFF" "#EEFFFF"])

+ 43 - 10
emacs/.emacs~

@@ -1,11 +1,32 @@
 ;; link to notes file:
 ;; ~/config_files/emacs/initial_notes.org
+;;{{{ Set up package and use-package
+
+(require 'package)
+(add-to-list 'package-archives
+             '("melpa" . "https://melpa.org/packages/") t)
 (package-initialize)
-(unless package-archive-contents
-  (package-refresh-contents))
 
-(unless (package-installed-p 'use-packages)
+;; Bootstrap 'use-package'
+(eval-after-load 'gnutls
+  '(add-to-list 'gnutls-trustfiles "/etc/ssl/cert.pem"))
+(unless (package-installed-p 'use-package)
+  (package-refresh-contents)
   (package-install 'use-package))
+(eval-when-compile
+  (require 'use-package))
+(require 'bind-key)
+(setq use-package-always-ensure t)
+
+;; enable time tracking in org-mode
+(setq org-clock-persist 'history)
+(org-clock-persistence-insinuate)
+
+(use-package ivy :demand
+  :config
+  (setq ivy-use-virtual-buffers t
+	ivy-count-format "%d/%d "))
+(ivy-mode 1)
 
 ;; (desktop-save-mode 1)
 ;; this will ensure that packages are always installed if not present
@@ -19,9 +40,12 @@
 ;; make escape key escape commands anywhere
 (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
 
-(use-package projectile)
-(define-key projectile-mode-map (kbd "s-p") 'projectile-command-map)
-(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
+(use-package projectile
+  :init
+  (projectile-mode +1)
+  :bind (:map projectile-mode-map
+              ("s-p" . projectile-command-map)
+              ("C-c p" . projectile-command-map)))
 
 (use-package markdown-mode
   :commands (markdown-mode gfm-mode)
@@ -69,11 +93,20 @@
 ;;(setq package-enable-at-startup nil)
 (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
 
-;; Org Mode Settings
+;; org-mode Settings
 ;; set up an agenda keybind
 (use-package org
   :config
-  (setq org-ellipsis "  ▼"))
+  (setq org-ellipsis "  ▼")
+  ;; set image width for inline images to nil, so they can be resized inline
+  (setq org-image-actual-width nil)
+  ;; make boldface font show red (useful for important/urgent)
+  (add-to-list 'org-emphasis-alist
+             '("*" (:foreground "red")
+               ))
+  )
+
+
 
 (global-set-key (kbd "C-c a") 'org-agenda)
 ;; enable org-bullet-mode, replace asterisks with bullets
@@ -163,7 +196,7 @@
 
     (use-package evil-collection
       :after evil
-      :config
+      config
       (evil-collection-init))
       
 
@@ -202,7 +235,7 @@
  '(org-agenda-files (quote ("~/TODO.org")))
  '(package-selected-packages
    (quote
-    (projectile evil-collection markdown-mode ivy-avy org-bullets doom-themes all-the-icons-ivy all-the-icons-gnus doom-modeline zenburn-theme lorem-ipsum ## powerline use-package evil-commentary undo-fu undo-tree evil notmuch)))
+    (darkroom projectile evil-collection markdown-mode ivy-avy org-bullets doom-themes all-the-icons-ivy all-the-icons-gnus doom-modeline zenburn-theme lorem-ipsum ## powerline use-package evil-commentary undo-fu undo-tree evil notmuch)))
  '(pdf-view-midnight-colors (cons "#EEFFFF" "#292D3E"))
  '(rustic-ansi-faces
    ["#292D3E" "#ff5370" "#c3e88d" "#ffcb6b" "#82aaff" "#c792ea" "#89DDFF" "#EEFFFF"])

+ 16 - 1
emacs/initial_notes.org

@@ -1,6 +1,12 @@
+* Edit hyperlink under point (or view it)
+C-c C-l
+
+* Expand / Collapse inline images
+C-c C-x C-v
+
 * Open file under cursor
 M-x find-file-at-point
-  
+
 * List all keybinds
 C-h b (opens in minibuffer)
 
@@ -25,7 +31,16 @@ C-x Right  / C-x Left
 * Dired mode, up a directory
 ^
 (note: should remap forward/backward dir nav to h/l, or C-h/C-l)
+
 * Dired mode, refresh directory (if changed on disk
 gr
+
 * For doom-mode-line, and all-the-icons, must install fonts
 M-x all-the-icons-install-fonts
+
+* Clocking / Logging time in org-mode
+** Clock in - C-c C-x C-i
+** Clock out - C-c C-x C-o
+** Adjust timestamp - S-up / S-down
+   - note that this is org-mode more generally
+** Show clock report - M-x org-clock-report

+ 18 - 10
i3/i3_config

@@ -30,6 +30,10 @@ bindsym $mod+t                          exec /usr/bin/thunderbird
 set $browser "firejail firefox"
 bindsym $mod+w                          exec $browser
 
+# set $browser "firejail brave-browser --incognito"
+set $browser "firejail brave-browser"
+bindsym $mod+b                          exec $browser
+
 # emacs
 bindsym $mod+e                          exec /usr/bin/emacs
 
@@ -48,6 +52,10 @@ bindsym $mod+p                          exec ~/source_packages/kalendar-master/s
 # run display select script
 bindsym $mod+F5                         exec --no-startup-id ~/config_files/dmenu_scripts/display_select.sh
 
+# take a screenshot with scrot
+bindsym --release Print exec scrot '%T_%d-%m-%Y'.png -s -e 'mv -n $f ~/screenshots/'
+bindsym $mod+Print exec scrot '%T_%d-%m-%Y'.png -e 'mv -n $f ~/screenshots/'
+
 ####################
 ## END LAUNCHERS ###
 ####################
@@ -102,16 +110,16 @@ bindsym $mod+a focus parent
 #bindsym $mod+d focus child
 
 # switch to workspace
-bindsym $mod+1 workspace 1
-bindsym $mod+2 workspace 2
-bindsym $mod+3 workspace 3
-bindsym $mod+4 workspace 4
-bindsym $mod+5 workspace 5
-bindsym $mod+6 workspace 6
-bindsym $mod+7 workspace 7
-bindsym $mod+8 workspace 8
-bindsym $mod+9 workspace 9
-bindsym $mod+0 workspace 10
+bindsym $mod+1 workspace number 1
+bindsym $mod+2 workspace number 2
+bindsym $mod+3 workspace number 3
+bindsym $mod+4 workspace number 4
+bindsym $mod+5 workspace number 5
+bindsym $mod+6 workspace number 6
+bindsym $mod+7 workspace number 7
+bindsym $mod+8 workspace number 8
+bindsym $mod+9 workspace number 9
+bindsym $mod+0 workspace number 10
 
 #
 bindsym $mod+Tab workspace next

+ 35 - 1
notes/cheatsheet.md

@@ -45,6 +45,14 @@ sudo chown -R apache:ec2-user path/to/wordpress
 or
 sudo chown -R apache:apache path/to/wordpress
 
+## Lambda
+### Creating a Lambda function (with cli IAM role creation)
+- first, create trust-policy.json
+- second, create role
+    - aws iam create-role --role-name {some role name} --assume-role-policy-document file://trust-policy.json
+- third, attach permissions
+    - aws iam attach-role-policy --role-name {some role name} --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
+
 ## Viewing logs from CLI
 - aws logs commands:
     - combined command, to get most recent log stream for a log group:
@@ -194,6 +202,13 @@ sudo chown -R apache:apache path/to/wordpress
     * --jobs=X to run parallel installs
     * for full system/world update: 
         * sudo emerge --update --changed-use --deep --ask --with-bdeps=y @world
+# GIMP
+## Highlight a section of an image
+- Select a brush
+- choose "Darken Only" mode.
+- Set size and color of brush
+- Click start of area to highlight.  Hold shift.  Click end of area.
+
 # GIT
 ## delete files from history (specifically large files)
 ### using bfg - recommended for removing large files
@@ -229,8 +244,15 @@ git show branch:filepath/filename
 ## grep / search history of files (source code)
 git grep {regex to search} $(git rev-list --all)
 # GPG
-## reset gpg-connect-agent / when borking pw entry 
+## reset gpg-connect-agent / clear stored passwords
     - echo RELOADAGENT | gpg-connect-agent
+# I3 (i3wm, window manager )
+## Move a window to a named workspace:
+- (mod+d to bring up dmenu) -  i3-msg move container to workspace number 1 firefox
+## open a named workspace
+- (mod+d to bring up dmenu) -  i3-msg workspace number 1 firefox
+
+
 # Javascript
 ## Run Prettier for code formatting, w/in vim
     - :Prettier
@@ -270,6 +292,12 @@ jupyter labextension install jupyter-matplotlib
     - This helped a great deal with an i3-based install, anyway
 
 # LINUX
+## install .deb package
+sudo dpkg -i filename.deb
+## OCR (extract text from image)
+- use tesseract-ocr
+- tesseract-ocr input.png output.txt
+
 ## toggle caps lock when xmm applied recklessly... locking CAPS LOCK on
 - xdotool key Caps_Lock
 ## Webcam/sound Recording tips
@@ -462,6 +490,8 @@ file -i {filename}
     - can always use 'kill -9'
 
 # NODE, NPM, NVM
+## Remap port 80 to port 3000, to access express app
+sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000
 ## install nvm
     - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
 ## nvm - install node
@@ -520,6 +550,10 @@ file -i {filename}
 ## change user/role pw:
     - \password {username}
 # PYTHON
+## super simple http server (!!)
+python3 -m http.server 1337
+- 1337 = port, optional
+
 ## install alternate version
 ### update, install deps
 $ sudo apt update

+ 32 - 0
vim/UltiSnips/html.snippets

@@ -0,0 +1,32 @@
+snippet <html "Add html boilerplate"
+<!doctype html>
+${0}
+<html lang="en">
+<head>
+  <meta charset="utf-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1">
+
+  <title>A Basic HTML5 Template</title>
+  <meta name="description" content="A simple HTML5 Template for new projects.">
+  <meta name="author" content="SitePoint">
+
+  <meta property="og:title" content="A Basic HTML5 Template">
+  <meta property="og:type" content="website">
+  <meta property="og:url" content="https://www.sitepoint.com/a-basic-html5-template/">
+  <meta property="og:description" content="A simple HTML5 Template for new projects.">
+  <meta property="og:image" content="image.png">
+
+  <link rel="icon" href="/favicon.ico">
+  <link rel="icon" href="/favicon.svg" type="image/svg+xml">
+  <link rel="apple-touch-icon" href="/apple-touch-icon.png">
+
+  <link rel="stylesheet" href="css/styles.css?v=1.0">
+
+</head>
+
+<body>
+  <!-- your content here... -->
+  <script src="js/scripts.js"></script>
+</body>
+</html>
+endsnippet

+ 9 - 1
vim/mappings.vim

@@ -28,8 +28,16 @@ nnoremap <leader>GG :setl smd sc cul cuc si list<cr>|
 nnoremap <leader>!p :!python3 %<cr>|                                                "shell out to run this program in python3
 nnoremap <leader>cd :cd %:p:h<CR>:pwd<CR>                                           "change pwd and print
 
-"-- seeing is believing commands
+" Commands to move lines up or down
+nnoremap <C-k> :m .-2<CR>==
+inoremap <C-k> <Esc>:m .-2<CR>==gi
+vnoremap <C-k> :m '<-2<CR>gv=gv
+nnoremap <C-j> :m .+1<CR>==
+inoremap <C-j> <Esc>:m .+1<CR>==gi
+vnoremap <C-j> :m '>+1<CR>gv=gv
+
 "-- run seeing_is_ believing on current buffer
+"-- seeing is believing commands
 nnoremap <leader>b :%!seeing_is_believing --timeout 12 --line-length 500 --number-of-captures 300 --alignment-strategy chunk<CR>;
 "-- clear seeing is believing in current buffer
 nnoremap <leader>c :%.!seeing_is_believing --clean<CR>;

+ 13 - 3
vim/plug.vim

@@ -10,6 +10,13 @@ call plug#begin()
     " List of Plugins"
     " note that { 'on': []}  is syntax for lazy loading
 
+    Plug 'sheerun/vim-polyglot'
+
+
+
+    " For JSX highlighting
+    Plug 'maxmellon/vim-jsx-pretty'
+
     Plug 'tpope/vim-surround'
 
     " repeat mainly for vim-surround
@@ -41,7 +48,7 @@ call plug#begin()
     Plug 'junegunn/limelight.vim'
 
     " Provide some functionality for markdown editing
-    ""Plug 'plasticboy/vim-markdown'
+    Plug 'plasticboy/vim-markdown'
 
     " tcomment toggles comments (gcc)
     Plug 'tomtom/tcomment_vim'
@@ -93,13 +100,16 @@ call plug#begin()
     Plug 'Xuyuanp/nerdtree-git-plugin'
 
     "  vim-indent-guides to show indentation levels - 2020-06-04 
-    Plug 'nathanaelkane/vim-indent-guides'
+    " Plug 'nathanaelkane/vim-indent-guides'
+    "
+    "Indentline for showing bars where code is indented
+    Plug 'Yggdroot/indentLine'
 
     " autocompletion
     " Plug 'ycm-core/YouCompleteMe'
 
     " " autocompletion for python
-    Plug 'davidhalter/jedi-vim'
+    " Plug 'davidhalter/jedi-vim'
 
     " ------------------------------------- "
     " ---- Javascript-specific plugins ---- "

+ 4 - 1
vim/settings.vim

@@ -13,7 +13,7 @@ set nosmartindent noautoindent  "smart indent and autoindent
 set autochdir               "change pwd when opening a file
 " set noautochdir             "dont' change pwd when opening a file
 "                             " changing makes project navigation harder
-set wrap linebreak tw=90    "window wrap, linebreak, textwidth
+set wrap linebreak tw=80    "window wrap, linebreak, textwidth
 ""set breakindent             "indent multi-line wrapped lines
 
 " note that light themes don't work well if xresources not using a light theme
@@ -25,6 +25,9 @@ set cursorline
 highlight clear SignColumn|                          "don't highlight the git gutter or Cursorline
 highlight Search ctermfg=green ctermbg=red|          "search highlighting colours
 
+let g:vim_markdown_conceal = 0
+let g:vim_markdown_conceal_code_blocks = 0
+
 " add parent dir for tags
 set tags+=../tags