dotfiles bugabingas dorkfiles
owned by bugabinga
README Source History Refs Reviews Compare Notes Search Review guide CI runs Merge branch 'trunk' of github.com:bugabinga/dotfiles into trunk
280d8f1666f3dd3ed9299d654dd9f52896561905
Oliver Krylow <o.krylow@isp-insoft.de > · 27 May 2022
unsigned
Browse files Compare with HEAD
Changed files (23) Diff layout Auto Unified Split
+2 / −1 text lines
5 5 bootstripper/win32/cross9 bootstripper/win32/cross9 6 6 tresor/box_do_key tresor/box_do_key 7 7 nushell/zoxide.nu nushell/zoxide.nu 8 - nushell/history.txt No final newline +0 / −4 text lines
12 12 - tokei: count lines of code- tokei: count lines of code13 13 - hyperfine: benchmark tool- hyperfine: benchmark tool14 14 - menyoki: capture screenshots, record gifs- menyoki: capture screenshots, record gifs15 - - rpick: Choose something out of predefined model using fancy algorithms
16 15 - tldr: tool documentation- tldr: tool documentation17 16 - grex: regular expression pattern generator- grex: regular expression pattern generator18 17 - xh: make HTTP requests- xh: make HTTP requests19 - - watchexec: filesystem watcher
20 18 - viu: view images in terminal (blocky approximation)- viu: view images in terminal (blocky approximation)21 19 - licensor: print a license text- licensor: print a license text22 20 - pastel: manage colors- pastel: manage colors31 29 - comrak: render markdown to html- comrak: render markdown to html32 30 - hx: terminal code editor- hx: terminal code editor33 31 - xplr: terminal file explorer- xplr: terminal file explorer34 - - coreutils: rust unix tools
35 32 - t-rec: terminal gifs- t-rec: terminal gifs36 33 - podcast: podcast manager- podcast: podcast manager37 34 - sic: image manipulation- sic: image manipulation38 35 - vivid: generate LS_COLORS- vivid: generate LS_COLORS39 36 - chars: unicode character info- chars: unicode character info40 - - hwatch: watch output of commands over time
41 37 - franklin-cli: evolutionary image filter- franklin-cli: evolutionary image filter42 38 - uggo: LoL builds- uggo: LoL buildsnew file mode 100644+35 / −0 text lines
7 + topgrade/topgrade.windows.toml8 + ~/AppData/Roaming/topgrade.toml11 + ~/AppData/Roaming/nushell14 + ~/AppData/Roaming/bottom17 + ~/AppData/Roaming/Sam Tay/so20 + ~/AppData/Roaming/Subversion/config25 + indexa/config.windows.toml26 + ~/AppData/Roaming/indexa/config.toml32 + ~/AppData/Roaming/helix/config.toml35 + ~/AppData/Roaming/helix/themesNo final newline +8 / −1 text lines
8 8 1. Install a JDK1. Install a JDK9 9 1. git clone git@github.com:bugabinga/dotfiles1. git clone git@github.com:bugabinga/dotfiles10 10 1. `cd dotfiles`1. `cd dotfiles`11 - 1. `java bootstripper.java . `11 + 1. `java bootstripper.java`13 13 > Pay attention to already existing symlinks!> Pay attention to already existing symlinks!
17 + Initial setup on windows is a little more sophisticated, because I am used to a developers environment.19 + 1. Enable Devoloper Mode, so that it is allowed to make symlinks without admin permissions.20 + 1. Install Build Tools with C++ Option (for Rust and cargo tools)15 22 ## rough goals ## rough goals 17 24 - minimal amount of dependencies- minimal amount of dependenciesbootstripper.java Modified +11 / −5 text lines
20 20 decrypt_secrets(dorkfiles_root.resolve("tresor" )); decrypt_secrets(dorkfiles_root.resolve("tresor" ));21 21 var hostname = hostname(); var hostname = hostname();22 22 log("Hostname: {0}" , emphasize_global(hostname)); log("Hostname: {0}" , emphasize_global(hostname));23 - var symlinks_file = hostname + ".symlinks" ;24 - create_symlinks(dorkfiles_root, dorkfiles_root . resolve ( symlinks_file)) ;23 + var symlinks_file = dorkfiles_root . resolve ( hostname + ".symlinks" ) ;24 + if (Files .exists(symlinks_file)) {25 + create_symlinks(dorkfiles_root, symlinks_file);27 + throw fail("Expected a file containing symlinks at: {0}. Found nothing!" , symlinks_file);27 31 static void decrypt_secrets(Path secrets_root) throws Throwable { static void decrypt_secrets(Path secrets_root) throws Throwable {57 61 var is_directory = Files .isDirectory(source_path); var is_directory = Files .isDirectory(source_path);58 62 if (Files .exists(target_path, LinkOption .NOFOLLOW_LINKS )) { if (Files .exists(target_path, LinkOption .NOFOLLOW_LINKS )) {59 63 if (Files .exists(target_path)) { if (Files .exists(target_path)) {60 - log("\n ✓ {0} already exists!\nNot linking {1}." , emphasize_global(target_path.toString()),64 + log("\n OK {0} already exists!\nNot linking {1}." , emphasize_global(target_path.toString()),61 65 emphasize_local(source_path.toString())); emphasize_local(source_path.toString()));64 - log("\n ❌ {0} exists, but it points into nirvana. Removing broken link!" , target_path.toString());68 + log("\n NOPE {0} exists, but it points into nirvana. Removing broken link!" , target_path.toString());65 69 Files .delete(target_path); Files .delete(target_path);68 - log("\n 🔗 {0} ➔ {1}." , emphasize_local(source_path.toString()),72 + log("\n LINK {0} TO {1}." , emphasize_local(source_path.toString()),69 73 emphasize_local(target_path.toString())); emphasize_local(target_path.toString()));70 74 Files .createDirectories(target_path.getParent()); Files .createDirectories(target_path.getParent());92 97 command.add(target_path.toString()); command.add(target_path.toString());93 98 command.add(source_path.toString()); command.add(source_path.toString());
99 + log(command.toString());94 100 process.inheritIO() process.inheritIO()96 102 .onExit() .onExit()cargo/config.toml Modified +1 / −10 text lines
9 9 [profile .release ][profile .release ]13 - [target .x86_64-pc-windows-msvc ]15 - linker = "lld-link.exe" 17 - [target .x86_64-unknown-linux-gnu ]19 - "-C" , "link-arg=-fuse-ld=lld" ,+0 / −3 text lines
3 2 name = Oliver Jan Krylow name = Oliver Jan Krylow 4 3 email = olver@bugabinga.net email = olver@bugabinga.net 61 60 path = .gitconfig.include path = .gitconfig.include 62 - [credential "helperselector" ]63 - selected = manager-core
git/gitconfig.PC-00625 Added new file mode 100644+19 / −0 text lines
3 + email = o.krylow@isp-insoft.de8 + [credential "helperselector"]9 + selected = manager-core18 + [difftool "code-difftool"]19 + cmd = code --wait --diff $LOCAL $REMOTENo final newline indexa/config.windows.toml Modified +1 / −2 text lines
nushell/config.nu Modified +2 / −1 text lines
3 2 use table.nu *use table.nu *5 4 use prompt.nu *use prompt.nu *6 5 use aliases.nu *use aliases.nu *7 6 use todo.nu *use todo.nu *8 7 use git.nu *use git.nu *11 12 use svn.complete.nu *use svn.complete.nu *+9 / −2 text lines
3 + let -env WIN32? = $nu.os-info.name =~ "windows" 4 + let -env NURC_DIR = ($nu.config-path | path expand | path dirname)5 + let -env DOTFILES = ($env.NURC_DIR | path join ".." | path expand) 6 + let -env WORKSPACE = if $env.WIN32 ? { "W:/misc" } else { "~/Workspace" } 7 + let -env CARGO_HOME = if $env.WIN32 ? { "C:/Users/okr/.cargo" } else { "~/.cargo" } 17 25 let -env NU_LIB_DIRS = [let -env NU_LIB_DIRS = [18 - ($nu.config-path | path dirname | path join 'tools' ),
19 26 ($nu.config-path | path dirname | path join 'modules' ), ($nu.config-path | path dirname | path join 'modules' ),20 27 ($nu.config-path | path dirname | path join 'completions' ) ($nu.config-path | path dirname | path join 'completions' )24 31 let -env NU_PLUGIN_DIRS = [let -env NU_PLUGIN_DIRS = [25 32 ($nu.config-path | path dirname | path join 'plugins' ), ($nu.config-path | path dirname | path join 'plugins' ),26 33 ($env.CARGO_HOME | path join 'bin' ), ($env.CARGO_HOME | path join 'bin' ),nushell/modules/aliases.nu Modified +11 / −0 text lines
6 6 export alias browse = firefoxexport alias browse = firefox7 7 export alias edit = hxexport alias edit = hx
13 + if ( which "sudo" | empty? ) {10 21 export alias aes = java (build-string $env.DOTFILES /tools/ aes.java)export alias aes = java (build-string $env.DOTFILES /tools/ aes.java)11 22 export alias download = java (build-string $env.DOTFILES /tools/ download.java)export alias download = java (build-string $env.DOTFILES /tools/ download.java)nushell/modules/environment.nu Deleted deleted file mode 100644+0 / −16 text lines
1 - export env GO111MODULE { "on" }2 - export env GOPATH { ($nu.home-path | path join '.go' ) }6 - prepend ($env.GOPATH | path join 'bin' )13 - export env WIN32? { (sys).host.name =~ "Windows" }14 - export env NURC_DIR { ($nu.config-path | path expand | path dirname) }15 - export env DOTFILES { ($env.NURC_DIR | path join ".." | path expand) }16 - export env WORKSPACE { if $env.WIN32 ? { "W:" } else { "~/Workspace" } }
nushell/modules/openssl.nu Added new file mode 100644+6 / −0 text lines
2 + export def ssh-keygen-ed [5 + ssh-keygen -t ed25519 -C $email nushell/modules/prompt.nu Modified +16 / −14 text lines
47 47 def icons [] {def icons [] {50 - [/home/oli/Workspace "🧬 " ]50 + [ " /home/oli/Workspace" (char -u "1f4bb " ) ]51 + [ "/home/oli" (char nf_house2) ]52 + [ "C:\\Users\\okr\\Workspaces" (char -u "1f4bb" ) ]53 + [ "C:\\Users\\okr" (char nf_house2) ]59 61 def set-window-title [] {def set-window-title [] {61 63 let pwd = ( $env.PWD | path expand ) let pwd = ( $env.PWD | path expand )62 - let icon = if (icons | any? path == $pwd ) { ( icons | where path == $pwd | get icon.0 ) } else { "📁 " }64 + let icon = if (icons | any? path == $pwd ) { ( icons | where path == $pwd | get icon.0 ) } else { $ "(char nf_folder1) " }64 66 if (env | any? name == TERM_PROGRAM) && $env.TERM_PROGRAM == WezTerm { if (env | any? name == TERM_PROGRAM) && $env.TERM_PROGRAM == WezTerm { 65 67 echo ([ (ansi title) $icon " " ( $pwd | path basename ) (ansi reset) ] | str collect) echo ([ (ansi title) $icon " " ( $pwd | path basename ) (ansi reset) ] | str collect)71 73 let pwd = ($env.PWD | path expand) let pwd = ($env.PWD | path expand) 73 75 let svn_relative_cmd = ( do --ignore-errors { ^svn info --show-item relative-url --no-newline $pwd } | complete ) let svn_relative_cmd = ( do --ignore-errors { ^svn info --show-item relative-url --no-newline $pwd } | complete )74 - let svn_relative_path = if ($svn_relative_cmd.exit_code == 0 ) { $" 🐢 ($svn_relative_cmd.stdout)" }76 + let svn_relative_path = if ($svn_relative_cmd.exit_code == 0 ) { $" 🐢 (char nf_branch) ( $svn_relative_cmd.stdout)" }76 78 let git_status = ( gstat ) let git_status = ( gstat )77 - let git_branch = if ( $git_status.branch != "no_branch" ) { $" ($git_status.branch)" }79 + let git_branch = if ( $git_status.branch != "no_branch" ) { $" (char nf_git) (char nf_branch) ( $git_status.branch)" }80 82 $svn_relative_path $svn_relative_path 90 92 let pwd = ($env.PWD | path expand) let pwd = ($env.PWD | path expand)91 - let pwd = (icons | reduce --fold $pwd { |item, accumulator| $accumulator | str replace $item.path $item.icon })93 + let pwd = (icons | reduce --fold $pwd { |item, accumulator| $accumulator | str replace --string $item.path $item.icon })92 94 let truncate_level = 5 let truncate_level = 5 93 - let truncate_symbol = "…/ " 95 + let truncate_symbol = $ "…(char path_sep) " 94 96 let path_segment = if ($pwd | path split | length) >= $truncate_level { ($pwd | path dirname --num-levels 2 --replace $truncate_symbol ) } else { $pwd } let path_segment = if ($pwd | path split | length) >= $truncate_level { ($pwd | path dirname --num-levels 2 --replace $truncate_symbol ) } else { $pwd }96 98 let vcs_segment = get_vcs_path let vcs_segment = get_vcs_path110 112 (date now | date format '%d.%m %R' ) (date now | date format '%d.%m %R' )111 113 ] | str collect) ] | str collect)113 - let command_status_segment = if $env.LAST_EXIT_CODE == 0 { " ✔ " } else { $"(ansi red) ✖ (ansi reset)" }114 - let command_duration_segment = if ($env.CMD_DURATION_MS |into int) > 50 { build-string $"($env.CMD_DURATION_MS)ms" | into duration } 115 + let command_status_segment = if $env.LAST_EXIT_CODE == 0 { $ " (char -u '2713') " } else { $"(ansi red) (char failed) (ansi reset)" }116 + let command_duration_segment = if ($env.CMD_DURATION_MS | into int) > 50 { $"($env.CMD_DURATION_MS)ms" | into duration } 117 119 (ansi red_bold) (ansi red_bold)135 - export env PROMPT_INDICATOR { $"(ansi purple) · (ansi reset)" }136 - export env PROMPT_INDICATOR_VI_INSERT { $"(ansi purple_reverse) : (ansi reset)" }137 - export env PROMPT_INDICATOR_VI_NORMAL { $"(ansi purple_bold) · (ansi reset)" }138 - export env PROMPT_MULTILINE_INDICATOR { $"(ansi purple_dimmed)·· (ansi reset)" }137 + export env PROMPT_INDICATOR { $"(ansi purple) (char prompt) (ansi reset)" }138 + export env PROMPT_INDICATOR_VI_INSERT { $"(ansi purple_reverse) (char pipe) (ansi reset)" }139 + export env PROMPT_INDICATOR_VI_NORMAL { $"(ansi purple_bold) (char prompt) (ansi reset)" }140 + export env PROMPT_MULTILINE_INDICATOR { $"(ansi purple_dimmed)(char prompt) (char prompt) ( ansi reset)" }nushell/modules/svn.nu Modified +1 / −1 text lines
42 42 "missing" : ( get-item-status-count $svn_status "missing" ) "missing" : ( get-item-status-count $svn_status "missing" )43 43 "obstructed" : "TODO" "obstructed" : "TODO" 44 44 "tree_conflicts" : ( $svn_status | get --ignore-errors status.children.target.children.entry.children.wc-status.attributes.tree-conflicted | flatten | flatten | compact | length) "tree_conflicts" : ( $svn_status | get --ignore-errors status.children.target.children.entry.children.wc-status.attributes.tree-conflicted | flatten | flatten | compact | length)45 - "changelists" : ( $svn_status | get --ignore-errors status.children.changelist | compact | flatten | get name )45 + "changelists" : ( $svn_status | get --ignore-errors status.children.changelist | compact | flatten | get --ignore-errors name )deleted file mode 100644+0 / −34 text lines
1 - register /home/oli/.cargo/bin/nu_plugin_gstat -e json {3 - "usage" : "Get the git status of a repo" ,6 - "required_positional" : [],7 - "optional_positional" : [10 - "desc" : "path to repo" ,13 - "default_value" : null16 - "rest_positional" : null,23 - "desc" : "Display this help message" ,25 - "default_value" : null29 - "creates_scope" : false,
+87 / −62 text lines
1 1 import static java .lang .System .out ;import static java .lang .System .out ;
2 + import static java .nio .file .StandardOpenOption .CREATE_NEW ;3 + import static java .nio .file .StandardOpenOption .READ ;4 + import static java .nio .file .StandardOpenOption .WRITE ;3 6 import java .nio .file .* ;import java .nio .file .* ;4 7 import java .nio .charset .* ;import java .nio .charset .* ;5 8 import java .nio .* ;import java .nio .* ;6 9 import java .io .* ;import java .io .* ;9 11 import java .security .* ;import java .security .* ;10 - import java .security .spec .* ;
12 13 import javax .crypto .* ;import javax .crypto .* ;13 14 import javax .crypto .spec .* ;import javax .crypto .spec .* ;15 16 class aes {class aes {16 - enum Command { ENCRYPT , DECRYPT };17 21 static Cipher AES_GCM_PKCS5 ; static Cipher AES_GCM_PKCS5 ;18 - static byte[] SALT = new byte [] { 116 , 104 , 101 , 32 , 109 , 111 , 111 , 110 , 32 , 105 , 115 , 32 , 104 , 105 , 100 , 100 , 101 , 110 , 32 , 105 , 110 , 32 , 112 , 108 , 97 , 105 , 110 , 32 , 118 , 105 , 101 , 119 };22 + static byte[] SALT = new byte [] { 116 , 104 , 101 , 32 , 109 , 111 , 111 , 110 , 32 , 105 , 115 , 32 , 104 , 105 , 100 , 100 , 101 ,23 + 110 , 32 , 105 , 110 , 32 , 112 , 108 , 97 , 105 , 110 , 32 , 118 , 105 , 101 , 119 };19 24 static SecureRandom RANDOM = new SecureRandom (); static SecureRandom RANDOM = new SecureRandom ();23 28 static int GCM_IV_SIZE = 12 ; static int GCM_IV_SIZE = 12 ;27 33 static int READ_BUFFER_SIZE = 128 ; static int READ_BUFFER_SIZE = 128 ;32 39 static int GCM_AUTH_TAG_SIZE = 96 ; static int GCM_AUTH_TAG_SIZE = 96 ;34 41 public static void main (String [] arguments) throws Throwable { public static void main (String [] arguments) throws Throwable {35 - if (arguments.length == 0 ){42 + if (arguments.length == 0 ) {37 44 throw fail(); throw fail();40 47 var input_command = arguments[0 ]; var input_command = arguments[0 ];41 48 Command command; Command command;42 - if ("encrypt" .startsWith(input_command)) { command = Command . ENCRYPT ; } 43 - else if ("decrypt" .startsWith(input_command)) { command = Command . DECRYPT ; } 44 - else { throw fail("unknown command %s given%n" , emphasize_global(input_command)); } 49 + if ("encrypt" .startsWith(input_command)) {50 + command = Command .ENCRYPT ;51 + } else if ("decrypt" .startsWith(input_command)) {52 + command = Command .DECRYPT ;54 + throw fail("unknown command %s given%n" , emphasize_global(input_command));46 57 AES_GCM_PKCS5 = Cipher .getInstance("AES/GCM/NoPadding" ); AES_GCM_PKCS5 = Cipher .getInstance("AES/GCM/NoPadding" );48 59 var console = System .console(); var console = System .console();54 - if (arguments.length != 3 || ! "--password-file" .equals(arguments[1 ])) {65 + if (console == null ) {66 + if (arguments.length != 3 || ! "--password-file" .equals(arguments[1 ])) {56 - throw fail ( "When running %s non-interactively, the %s flag is required.%nOtherwise there is no way to securely obtain the password.%n" ,emphasize_local ( " aes " ) , emphasize_global ( " --password-file " ) ) ; 69 + "When running %s non-interactively, the %s flag is required.%nOtherwise there is no way to securely obtain the password.%n" ,70 + emphasize_local("aes" ), emphasize_global("--password-file" ));58 72 var password_file = Path .of(arguments[2 ]); var password_file = Path .of(arguments[2 ]);59 - if ( ! Files . exists ( password_file ) ) { throw fail("the given password file %s does not exist%n" , emphasize_local(password_file.toString())); } 73 + if (! Files .exists(password_file)) {74 + throw fail("the given password file %s does not exist%n" , emphasize_local(password_file.toString()));60 76 var password = toChars(Files .readAllBytes(password_file)); var password = toChars(Files .readAllBytes(password_file));61 77 switch (command) { switch (command) {62 78 case ENCRYPT : case ENCRYPT : 63 79 encrypt(password, System .in, System .out); encrypt(password, System .in, System .out);65 81 case DECRYPT : case DECRYPT : 66 82 decrypt(password, System .in, System .out); decrypt(password, System .in, System .out);71 - if (arguments.length <= 1 ) {86 + if (arguments.length <= 1 ) {73 88 throw fail("not enough arguments given%n" ); throw fail("not enough arguments given%n" );75 90 char[] password; char[] password;76 91 String input; String input;77 92 String output; String output;78 - if ("--password-file" .equals(arguments[1 ])) {79 - if (arguments.length != 5 ) {93 + if ("--password-file" .equals(arguments[1 ])) {94 + if (arguments.length != 5 ) {81 96 throw fail("the flag %s requires a path%n" , emphasize_local("--password-file" )); throw fail("the flag %s requires a path%n" , emphasize_local("--password-file" ));83 98 var password_file = Path .of(arguments[2 ]); var password_file = Path .of(arguments[2 ]);84 - if ( ! Files . exists ( password_file ) ) { throw fail("the given password file %s does not exist%n" , emphasize_local(password_file.toString())); } 99 + if (! Files .exists(password_file)) {100 + throw fail("the given password file %s does not exist%n" , emphasize_local(password_file.toString()));85 102 password = toChars(Files .readAllBytes(password_file)); password = toChars(Files .readAllBytes(password_file));86 103 input = arguments[3 ]; input = arguments[3 ];87 104 output = arguments[4 ]; output = arguments[4 ];90 - if (arguments.length != 3 ) {106 + if (arguments.length != 3 ) {92 108 throw fail("when encrypting/decrypting a file, an output path is required%n" ); throw fail("when encrypting/decrypting a file, an output path is required%n" );94 - password = console.readPassword("[%s]:" ,emphasize_global("Password" ));110 + password = console.readPassword("[%s]:" , emphasize_global("Password" ));95 111 input = arguments[1 ]; input = arguments[1 ];96 112 output = arguments[2 ]; output = arguments[2 ];99 115 var input_path = Path .of(input); var input_path = Path .of(input);100 - if ( ! Files . exists ( input_path ) ) { throw fail("the given input path %s does not exist%n" , emphasize_global(input_path.toString())); } 116 + if (! Files .exists(input_path)) {117 + throw fail("the given input path %s does not exist%n" , emphasize_global(input_path.toString()));101 119 var output_path = Path .of(output); var output_path = Path .of(output);102 - if ( Files . exists ( output_path ) ) { throw fail("the output path %s already exists%n" , emphasize_global(output_path.toString())); } 120 + if (Files .exists(output_path)) {121 + throw fail("the output path %s already exists%n" , emphasize_global(output_path.toString()));104 - var input_stream = Files .newInputStream(input_path, StandardOpenOption .READ );105 - var output_stream = Files .newOutputStream(output_path, StandardOpenOption .CREATE_NEW , StandardOpenOption .WRITE );109 - encrypt(password, input_stream, output_stream);112 - decrypt(password, input_stream, output_stream);124 + try (var input_stream = Files .newInputStream(input_path, READ );125 + var output_stream = Files .newOutputStream(output_path, CREATE_NEW , WRITE );) {128 + encrypt(password, input_stream, output_stream);131 + decrypt(password, input_stream, output_stream);116 136 throw exit(); throw exit();122 142 var initialization_vector = new byte [GCM_IV_SIZE ]; var initialization_vector = new byte [GCM_IV_SIZE ];123 143 RANDOM .nextBytes(initialization_vector); RANDOM .nextBytes(initialization_vector);125 146 output.write(initialization_vector); output.write(initialization_vector);126 147 var secret = toSecretKey(password); var secret = toSecretKey(password);127 148 var parameter_spec = new GCMParameterSpec (GCM_AUTH_TAG_SIZE , initialization_vector); var parameter_spec = new GCMParameterSpec (GCM_AUTH_TAG_SIZE , initialization_vector);130 151 var read_buffer = new byte [READ_BUFFER_SIZE ]; var read_buffer = new byte [READ_BUFFER_SIZE ];131 152 var aes_buffer = new byte [READ_BUFFER_SIZE ]; var aes_buffer = new byte [READ_BUFFER_SIZE ];132 153 int read_bytes_count = 0 ; int read_bytes_count = 0 ;133 - while ((read_bytes_count = input.read(read_buffer)) != - 1 ){134 - var aes_bytes_count = AES_GCM_PKCS5 .update(read_buffer, 0 , read_bytes_count, aes_buffer); 135 - output.write(aes_buffer, 0 , aes_bytes_count);154 + while ((read_bytes_count = input.read(read_buffer)) != - 1 ) {155 + var aes_bytes_count = AES_GCM_PKCS5 .update(read_buffer, 0 , read_bytes_count, aes_buffer);156 + output.write(aes_buffer, 0 , aes_bytes_count);137 158 output.write(AES_GCM_PKCS5 .doFinal()); output.write(AES_GCM_PKCS5 .doFinal());140 161 static void decrypt(char[] password, InputStream input, OutputStream output) throws Exception { static void decrypt(char[] password, InputStream input, OutputStream output) throws Exception {142 163 var initialization_vector = new byte [GCM_IV_SIZE ]; var initialization_vector = new byte [GCM_IV_SIZE ];143 164 input.read(initialization_vector); input.read(initialization_vector);144 165 var parameter_spec = new GCMParameterSpec (GCM_AUTH_TAG_SIZE , initialization_vector); var parameter_spec = new GCMParameterSpec (GCM_AUTH_TAG_SIZE , initialization_vector);148 169 var read_buffer = new byte [READ_BUFFER_SIZE ]; var read_buffer = new byte [READ_BUFFER_SIZE ];149 170 var aes_buffer = new byte [READ_BUFFER_SIZE ]; var aes_buffer = new byte [READ_BUFFER_SIZE ];150 171 int read_bytes_count = 0 ; int read_bytes_count = 0 ;151 - while ((read_bytes_count = input.read(read_buffer)) != - 1 ){152 - var aes_bytes_count = AES_GCM_PKCS5 .update(read_buffer, 0 , read_bytes_count, aes_buffer); 153 - output.write(aes_buffer, 0 , aes_bytes_count);172 + while ((read_bytes_count = input.read(read_buffer)) != - 1 ) {173 + var aes_bytes_count = AES_GCM_PKCS5 .update(read_buffer, 0 , read_bytes_count, aes_buffer);174 + output.write(aes_buffer, 0 , aes_bytes_count);160 182 output.write(AES_GCM_PKCS5 .doFinal()); output.write(AES_GCM_PKCS5 .doFinal());164 187 static SecretKey toSecretKey(char[] password) throws Exception { static SecretKey toSecretKey(char[] password) throws Exception {165 188 var factory = SecretKeyFactory .getInstance("PBKDF2WithHmacSHA256" ); var factory = SecretKeyFactory .getInstance("PBKDF2WithHmacSHA256" );166 189 var spec = new PBEKeySpec (password, SALT , 65536 , 256 ); var spec = new PBEKeySpec (password, SALT , 65536 , 256 );167 - return new SecretKeySpec (factory.generateSecret(spec).getEncoded() , "AES" );190 + return new SecretKeySpec (factory.generateSecret(spec).getEncoded(), "AES" );170 193 static char[] toChars(byte[] bytes) { static char[] toChars(byte[] bytes) {176 199 static void usage() { static void usage() {177 200 out.printf("%s encrypts/decrypts data.%n" , emphasize_local("Symmetrically " )); out.printf("%s encrypts/decrypts data.%n" , emphasize_local("Symmetrically " ));178 - out.printf("%s: java aes.java <e(ncrypt)|d(ecrypt)> [--password-file <path>] <input path> <output path>%n" , emphasize_global ( " Usage for files " ) ) ; 179 - out.printf("%s: java aes.java <e(ncrypt)|d(ecrypt)> --password-file <path>%n" , emphasize_global("Usage for stdin/stdout" ));201 + out.printf("%s: java aes.java <e(ncrypt)|d(ecrypt)> [--password-file <path>] <input path> <output path>%n" ,202 + emphasize_global("Usage for files" ));203 + out.printf("%s: java aes.java <e(ncrypt)|d(ecrypt)> --password-file <path>%n" ,204 + emphasize_global("Usage for stdin/stdout" ));182 207 static Throwable exit() { static Throwable exit() {183 208 out.printf("%s!%n" , emphasize_local("Done" )); out.printf("%s!%n" , emphasize_local("Done" ));184 209 System .exit(0 ); System .exit(0 );186 - return new Throwable (); 211 + return new Throwable ();189 214 static String emphasize_global(String message) { static String emphasize_global(String message) {197 222 static Throwable fail(String message, Object ... arguments) { static Throwable fail(String message, Object ... arguments) {198 223 out.printf(message, arguments); out.printf(message, arguments);199 224 System .exit(- 1 ); System .exit(- 1 );201 - return new Throwable (); 226 + return new Throwable ();204 229 static Throwable fail() { static Throwable fail() {205 230 System .exit(- 1 ); System .exit(- 1 );207 - return new Throwable (); 232 + return new Throwable ();tools/cargo-tools.nu Added new file mode 100644+59 / −0 text lines
32 + let cargo_git_crates = [33 + "https://github.com/mosmeh/indexa" 36 + def install-helix-editor [] {38 + git clone https://github.com/helix-editor/helix40 + cargo install --locked --path helix-term46 + $cargo_crates | each { |crate|47 + if ( which $crate | empty? ) {48 + cargo install --locked $crate 50 + echo $"($crate) already installed" 54 + $cargo_git_crates | each { |crate| 55 + cargo install --locked --git $crate tools/cargo_tools.nu Deleted deleted file mode 100644+0 / −49 text lines
31 - let cargo_git_crates = [32 - "https://github.com/mosmeh/indexa" 37 - git clone https://github.com/helix-editor/helix39 - cargo install --path helix-term45 - cargo install --locked $cargo_crates 46 - cargo install --locked nu --all-features47 - $cargo_git_crates | each {|it| cargo install --locked --git $it }
new file mode 100644+55 / −0 text lines
12 + BitstreamVeraSansMono38 + fonts_dir= "${HOME}/.local/share/fonts" 40 + if [[ ! -d "$fonts_dir" ]] ; then 41 + mkdir -p "$fonts_dir" 44 + for font in "${fonts[@]}" ; do 45 + zip_file= "${font}.zip" 46 + download_url= "https://github.com/ryanoasis/nerd-fonts/releases/download/v${version}/${zip_file}" 47 + echo "Downloading $download_url" 49 + unzip "$zip_file" -d "$fonts_dir" 53 + find "$fonts_dir" -name '*Windows Compatible*' -deletetools/nerd_font.sh Deleted deleted file mode 100755+0 / −55 text lines
12 - BitstreamVeraSansMono38 - fonts_dir= "${HOME}/.local/share/fonts" 40 - if [[ ! -d "$fonts_dir" ]] ; then 41 - mkdir -p "$fonts_dir" 44 - for font in "${fonts[@]}" ; do 45 - zip_file= "${font}.zip" 46 - download_url= "https://github.com/ryanoasis/nerd-fonts/releases/download/v${version}/${zip_file}" 47 - echo "Downloading $download_url" 49 - unzip "$zip_file" -d "$fonts_dir" 53 - find "$fonts_dir" -name '*Windows Compatible*' -delete
topgrade/topgrade.windows.toml Modified +13 / −8 text lines
2 + disable = ["wsl " , " tldr" ]4 4 assume_yes = true assume_yes = true 20 - repos = ["W:/misc/*/" ]20 + repos = ["W:/misc/*/" , " W:/*/ " ]22 22 max_concurrency = 12 max_concurrency = 12 27 27 arguments = "--ff --rebase --autostash" arguments = "--ff --rebase --autostash" 35 - "Refresh dotfiles" = "java W:/misc/ dotfiles/bootstripper.java W:/misc/ dotfiles" 38 + "00 - Refresh dotfiles" = "java W:/dotfiles/bootstripper.java W:/dotfiles" 38 - "TLDR" = "tldr --update" 40 + "01 - Install Cargo Tools" = "nu W:/dotfiles/tools/cargo-tools.nu" 41 - "Advantage-PM Client" = ". D:/Tools/update_apm_client.ps1" 42 - "MeMate" = ". D:/Tools/update_memate.ps1" 43 + "02 - Advantage-PM Client" = "nu X:/update_apm_client.nu" 44 + "03 - MeMate" = "nu X:/update_memate.nu" 45 - "Indexa Update" = "ix --update" 47 + "04 - Indexa Update" = "ix --update" 50 + "05 - TLDR" = "tldr --update" No final newline