This file contains hidden or 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
| sudo apt install bash-git-prompt | |
| PS1='$( | |
| # choose symbol & color | |
| last_exit=${LAST_EXIT:-0} | |
| if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then | |
| symbol="⎇"; color="\033[0;32m" # green in git repo | |
| else | |
| symbol="λ"; color="\033[0;36m" # cyan otherwise | |
| fi |
This file contains hidden or 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
| export PROMPT_COMMAND=' | |
| # Get relative path (~ instead of /home/user) | |
| relpath=$PWD | |
| case "$relpath" in | |
| $HOME*) relpath="~${relpath#$HOME}";; | |
| esac | |
| [ ${#relpath} -gt 30 ] && relpath="…${relpath: -30}" | |
| # Get current git branch if inside a repo | |
| branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| # Rebase and GPG/SSH sign the last N (or all unsigned) commits. | |
| # Non-interactive, skips empty commits, with CLI flags for help and verbosity. | |
| set -euo pipefail | |
| # --- Colors --- | |
| RED='\033[0;31m' | |
| GREEN='\033[0;32m' | |
| YELLOW='\033[1;33m' |
This file contains hidden or 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
| docker run --rm --gpus all -p 11434:11434 ollama/ollama:latest | |
| #with persistent storage of models | |
| docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 ollama/ollama:latest | |
| #if wanting to use webui | |
| docker run -d -p 8080:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main | |
| #query models | |
| firefox http://localhost:8080 |
This file contains hidden or 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
| # https://learn.microsoft.com/en-us/windows/wsl/disk-space#how-to-repair-a-vhd-mounting-error | |
| (Get-ChildItem -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | Where-Object { $_.GetValue("DistributionName") -eq 'Ubuntu' }).GetValue("BasePath") + "\ext4.vhdx" | |
| wsl --shutdwon | |
| wsl.exe --mount <path-to-ext4.vhdx> --vhd --bare | |
| wsl -d Ubuntu -e sudo fsck -y /dev/sda |
This file contains hidden or 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
| import re | |
| import random | |
| def binary_logic_choice(options): | |
| # Randomly choose option A or B | |
| choice_A_or_B = random.choice(["A", "B"]) | |
| choice = options.get(choice_A_or_B, "") | |
| # Implementing binary digital logic to decide if option C should be picked | |
| pick_A = random.choice([True, False]) |
This file contains hidden or 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
| alias randman='dir="/bin"; man $(ls $dir |sed -n "$(echo $(( $RANDOM % $(ls $dir |wc -l | awk "{ print $1; }" ) + 1 )) )p")' |
This file contains hidden or 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
| This is a note on how to cross compile opencv for pretty much any ARM device(HardFP supported in this case) and deploy. Native | |
| compiling in ARM devices can be painfully slow and they seem to hang often during build(mine got stuck at 43%). So if you happen | |
| to have a desktop/laptop/server running ubuntu or similar linux distro, u can build opencv in fractionth of the time taken for | |
| native compiling without any issues. | |
| Building opencv3 with TBB and NEON and VFP support can boost opencv performance. Thanks to Adrian at pyimagesearch for pointing | |
| that out. | |
| Both my PC and target machine aka orange pi zero are running ubuntu 16.04 with python2.7 and python 3.5. | |
| Let us use the term "build machine" for your PC where you are building opencv and "target machine" for the ARM single board computer. | |
| 1.Run the following commands in both machines(I think installing these in target machine only would do) to install the necessary libraries etc.(mine worked with them,so they should be enough |
This file contains hidden or 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/sh | |
| # | |
| # cp to .git/hooks | |
| # chomd +x .git/hooks/pre_commit | |
| # | |
| # This hook checks for wildcard imports (other than kotlinx) when added to staging. | |
| # TODO: add ktlint check | |
| RED='\033[0;31m' | |
| GREEN='\033[0;32m' |
This file contains hidden or 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
| 1/30/2019 | |
| Python 2.7.12 (default, Nov 12 2018, 14:36:49) | |
| [GCC 5.4.0 20160609] on linux2 | |
| Type "help", "copyright", "credits" or "license" for more information. | |
| >>> import rglob | |
| >>> rglob.lcount("/media/chris/UBNT/tensorFlowExample/tensorflow","*.py") | |
| 3268693 | |
| >>> rglob.lcount("/media/chris/UBNT/tensorFlowExample/tensorflow","*.java") | |
| 245116 |
NewerOlder