<commit_before>+ [[../index.org][Main Index]]

* Workflows
+ [[./git.org][Git Workflow]]
+ [[./js.org][Javascript Workflow]]
+ [[./om_next.org][Om Next Workflow]]
+ [[./org.org][Org features etc]]
* Commands
+ Open a gui file browser from command line
  #+BEGIN_SRC sh
    xdg-open . &
  #+END_SRC
+ Connect to remote file system from the xdg thingy
  #+BEGIN_SRC sh
    sftp://root@servername/directory
  #+END_SRC
+ Pull on all repos under the pwd.
  #+BEGIN_SRC sh
    find . -name .git -type d -execdir git pull -v ';'
  #+END_SRC
+ Add a new remote to a git repo
  #+BEGIN_SRC sh
    git remote add origin url
  #+END_SRC
+ Set a git remote to a new url
  #+BEGIN_SRC sh
    git remote set-url origin new-url-here
  #+END_SRC
+ Set up a symlink for nonexist file
  #+BEGIN_SRC sh
    ln -s source/file symlink/file
  #+END_SRC
+ Update a symlink
  #+BEGIN_SRC sh
    ln -sf source/file symlink/file
  #+END_SRC
+ Add github ssh key to server
  #+BEGIN_SRC sh
    cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'
  #+END_SRC
+ cd into dir that executable resides in
  #+BEGIN_SRC sh
    cd $(dirname $(which executable_name))
  #+END_SRC
+ find all files under the current directory that matches a pattern
  #+BEGIN_SRC sh
    find . -name "*.el"
  #+END_SRC
+ Run a simple local http server
  #+BEGIN_SRC sh
    python -m SimpleHTTPServer 8000
  #+END_SRC
+ Rename files that match a glob in the current directory
  #+BEGIN_SRC sh
    rename -n 's/ed-style/regex/' *.mp4
  #+END_SRC
+ POST with curl
  #+BEGIN_SRC sh
    curl -X POST \
         -H "Content-Type:application/json" \
         -d '{"topic":"topicName"}' \
         localhost:3031/addTopic
  #+END_SRC
+ Replace all occurences of foo with bar in all files recursively under the current directory
  #+BEGIN_SRC sh
    find . -type f -exec sed -i '' -e 's/var/let/g' {} +
  #+END_SRC
<commit_msg>added ncdu command because I always forget it<commit_after>+ [[../index.org][Main Index]]

* Workflows
+ [[./git.org][Git Workflow]]
+ [[./js.org][Javascript Workflow]]
+ [[./om_next.org][Om Next Workflow]]
+ [[./org.org][Org features etc]]
* Commands
+ Open a gui file browser from command line
  #+BEGIN_SRC sh
    xdg-open . &
  #+END_SRC
+ Connect to remote file system from the xdg thingy
  #+BEGIN_SRC sh
    sftp://root@servername/directory
  #+END_SRC
+ Pull on all repos under the pwd.
  #+BEGIN_SRC sh
    find . -name .git -type d -execdir git pull -v ';'
  #+END_SRC
+ Add a new remote to a git repo
  #+BEGIN_SRC sh
    git remote add origin url
  #+END_SRC
+ Set a git remote to a new url
  #+BEGIN_SRC sh
    git remote set-url origin new-url-here
  #+END_SRC
+ Set up a symlink for nonexist file
  #+BEGIN_SRC sh
    ln -s source/file symlink/file
  #+END_SRC
+ Update a symlink
  #+BEGIN_SRC sh
    ln -sf source/file symlink/file
  #+END_SRC
+ Add github ssh key to server
  #+BEGIN_SRC sh
    cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'
  #+END_SRC
+ cd into dir that executable resides in
  #+BEGIN_SRC sh
    cd $(dirname $(which executable_name))
  #+END_SRC
+ find all files under the current directory that matches a pattern
  #+BEGIN_SRC sh
    find . -name "*.el"
  #+END_SRC
+ Run a simple local http server
  #+BEGIN_SRC sh
    python -m SimpleHTTPServer 8000
  #+END_SRC
+ Rename files that match a glob in the current directory
  #+BEGIN_SRC sh
    rename -n 's/ed-style/regex/' *.mp4
  #+END_SRC
+ POST with curl
  #+BEGIN_SRC sh
    curl -X POST \
         -H "Content-Type:application/json" \
         -d '{"topic":"topicName"}' \
         localhost:3031/addTopic
  #+END_SRC
+ Replace all occurences of foo with bar in all files recursively under the current directory
  #+BEGIN_SRC sh
    find . -type f -exec sed -i '' -e 's/var/let/g' {} +
  #+END_SRC
+ View disk space usage
  #+BEGIN_SRC sh
    ncdu
  #+END_SRC

{'fraction_non_alphanumeric': 0.11775362318840579, 'fraction_numerical': 0.004658385093167702, 'mean_word_length': 2.9641025641025642, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2443339', 'n_tokens_mistral': 1459, 'n_tokens_neox': 1382, 'n_words': 477}