Blog: 2024-09-17: Difference between revisions

From razwiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 29: Line 29:
RONIN_DISK="$RONIN_HOME/ronin-disk.qcow2"
RONIN_DISK="$RONIN_HOME/ronin-disk.qcow2"
<... etc>
<... etc>
</pre>

----

Working on my editor, trying to pull up ipython, I got an error about my python profile. Ok so I removed my startup script and now ipython has a broken symlink. unsymlink failed silently: I forgot the ; before and:

is-symlink $file and rm $file

should have been

is-symlink $file; and rm $file

Turns out `move` had the same error. But even after fixing it, it didn't do what it said in the readme:

<pre>
Also warns you if you are trying to move a directory symlink which is ending in slash:

```
$ mkdir mydir
$ ln -s mydir mylink
$ mv mylink/ renamed
mv: cannot move 'mylink/' to 'renamed': Not a directory
```

`move` gives a more descriptive error:

```
$ move mylink/ renamed
move: `from` argument "mylink/" is a symlink with a trailing slash.
move: to rename a symlink, remove the trailing slash from the argument.
```

This arises because tab completion adds the slash. Completion for `move` could avoid the slash, but then again you might want to move a file within the symlinked directory.
</pre>

In reality:

<pre>
hack $ mkdir-cd fish-stuff3
fish-stuff3 $ mkdir mydir
fish-stuff3 $ ln -s mydir/ mylink
fish-stuff3 $ unsymlink ./mylink
fish-stuff3 $ ln -s mydir mylink
fish-stuff3 $ command mv mylink/ renamed
fish-stuff3 $
fish-stuff3 $ # uhh no error
</pre>

ok so in order to get a vm on mac (cause ronin is broken anyways :( ) I saw this forum post: https://forums.macrumors.com/threads/is-there-something-like-windows-subsystem-for-linux-wsl-on-mac.2381667/

which led me to https://github.com/canonical/multipass

which is kinda like ronin but only for ubuntu? Anyways it works~

<pre>
fish-stuff2 $ multipass shell
Launched: primary
Mounted '/Users/razzi' into 'primary:Home'
Welcome to Ubuntu 24.04.1 LTS (GNU/Linux 6.8.0-44-generic x86_64)
...
</pre>
</pre>

Revision as of 23:22, 17 September 2024

More editor ideas: either don't clear scrollback, or if you do clear scrollback, output the changes as a diff

$ edit ronin
diff --git a/ronin b/ronin
index 2805e3b..5cdfd6d 100755
--- a/ronin
+++ b/ronin
@@ -50,8 +50,8 @@ ronin_launch() {
     -hda "$RONIN_DISK" \
     -m 4096 \
     -nic hostfwd=tcp::2022-:22 \
-    -daemonize \

or

$ edit ronin
#!/bin/sh
# Create a virtual machine and log in

set -e

test ! -z "$RONIN_DEBUG" && set -x

RONIN_HOME="$HOME/.ronin"
RONIN_CACHE="$HOME/.cache/ronin"
RONIN_DISK="$RONIN_HOME/ronin-disk.qcow2"
<... etc>

Working on my editor, trying to pull up ipython, I got an error about my python profile. Ok so I removed my startup script and now ipython has a broken symlink. unsymlink failed silently: I forgot the ; before and:

is-symlink $file and rm $file

should have been

is-symlink $file; and rm $file

Turns out `move` had the same error. But even after fixing it, it didn't do what it said in the readme:

Also warns you if you are trying to move a directory symlink which is ending in slash:

```
$ mkdir mydir
$ ln -s mydir mylink
$ mv mylink/ renamed
mv: cannot move 'mylink/' to 'renamed': Not a directory
```

`move` gives a more descriptive error:

```
$ move mylink/ renamed
move: `from` argument "mylink/" is a symlink with a trailing slash.
move: to rename a symlink, remove the trailing slash from the argument.
```

This arises because tab completion adds the slash. Completion for `move` could avoid the slash, but then again you might want to move a file within the symlinked directory.

In reality:

hack $ mkdir-cd fish-stuff3
fish-stuff3 $ mkdir mydir
fish-stuff3 $ ln -s mydir/ mylink
fish-stuff3 $ unsymlink ./mylink 
fish-stuff3 $ ln -s mydir mylink
fish-stuff3 $ command mv mylink/ renamed
fish-stuff3 $ 
fish-stuff3 $ # uhh no error

ok so in order to get a vm on mac (cause ronin is broken anyways :( ) I saw this forum post: https://forums.macrumors.com/threads/is-there-something-like-windows-subsystem-for-linux-wsl-on-mac.2381667/

which led me to https://github.com/canonical/multipass

which is kinda like ronin but only for ubuntu? Anyways it works~

fish-stuff2 $ multipass shell
Launched: primary
Mounted '/Users/razzi' into 'primary:Home'
Welcome to Ubuntu 24.04.1 LTS (GNU/Linux 6.8.0-44-generic x86_64)
...