--- /dev/null
+---
+title: "server"
+date: 2023-08-03
+category: cli
+---
+
+
+- Intel nuc i3
+- CPU: Intel i3-3217U (4 core) @ 1.7 GHz
+- Memory: 16Gb
+- OS: Manjaro Linux x86_64
+- Shell: zsh
+
+
+
+## packages
+
+- [mosh](https://mosh.org/) roaming ssh sessions
+- [tmux](https://github.com/tmux/tmux/wiki) terminal multiplexer
+- [zerotier](https://www.zerotier.com/) vpn
+- [resilio sync](https://www.resilio.com/) file sync
+- [keepasstouch](https://keepassxc.org/) password safe
+
+<!--
+## installation
+
+from desktop
+
+```sh
+# gen and copy ssh key to server
+ssh-keygen -t rsa
+ssh-copy-id [user@]host
+
+# ssh into server
+ssh user@server
+```
+
+Arch setup
+```sh
+# arch setup
+
+# enter into root
+sudo -i
+
+# update and sync all packages
+pacman -Syu mosh tmux
+
+# install packges
+
+
+```
+
+Ubuntu Setup
+```sh
+# ubuntu setup
+```
+
+
+ -->
\ No newline at end of file
mel notepad with various code snippets
-
+## nodes
process selection list
-<pre class="prettyprint lang-mel">string $select[] = `ls -sl`;
+
+```php
+string $select[] = `ls -sl`;
for ( $node in $select ) // process each
{
/* ... */
}
-</pre>
-
-<br />
+```
if node exists
-<pre class="prettyprint lang-mel">
+
+```php
string $node = "object";
if ( `objExists $node` )
{
// The node exists
}
-</pre>
+```
-<h2>regexp</h2>
+## regexp
Strip component
-<pre class="prettyprint lang-mel">
+
+```php
string $node = "pCube1.f[2]";
string $no_component = `match "^[^\.]*" $node`;
// Result: "pCube1" //
-</pre>
+```
-<!--more-->
-<br />
Extract component or attribute, with '.'
-<pre class="prettyprint lang-mel">
+
+```php
string $node = "pCube1.f[2]";
string $component = `match "\\..*" $node`;
// Result: ".f[2]" //
string $nodeAttr = "blinn1.color";
string $attrName = `match "\\..*" $nodeAttr`;
// Result: ".color" //
-</pre>
+```
-<br />
Extract attribute name, without '.'
-<pre class="prettyprint lang-mel">
+
+```php
string $node = "pCube1.f[2]";
string $component = `substitute "^[^.]*\\." $node ""`;
// Result: "f[2]" //
string $nodeAttr = "blinn1.color";
string $attrName = `substitute "^[^.]*\\." $nodeAttr ""`;
// Result: "color" //
-</pre>
+```
-<br />
Extract parent UI control from full path
-<pre class="prettyprint lang-mel">
+
+```php
string $uiControl = "OptionBoxWindow|formLayout52|formLayout55|button6";
string $uiParent = `substitute "|[^|]*$" $uiControl ""`;
// Result: OptionBoxWindow|formLayout52|formLayout55 //
-</pre>
+```
+
+Strip trailing Line Break (\n), if any.This is useful when processing text input read from a file using `fgetline`.
-<br />
-Strip trailing Line Break (\n), if any. <br /><br />This is useful when processing text input read from a file using `fgetline`.
-<pre class="prettyprint lang-mel">
+```php
string $input = "line\n";
$string $line = `match "^[^(\r\n)]*" $input`;
// Result: "line" //
-</pre>
+```
-<br />
Extract directory from path.
-<br /><br />
Keep the trailing slash for ease of use.
-<pre class="prettyprint lang-mel">
+
+```php
string $path = "C:/AW/Maya5.0/bin/maya.exe";
string $dir = `match "^.*/" $path`;
// Result: "C:/AW/Maya5.0/bin/"
-</pre>
+```
-<br />
Extract file from path
-<pre class="prettyprint lang-mel">
+
+```php
string $path = "C:/AW/Maya5.0/bin/maya.exe";
string $filepart = `match "[^/\\]*$" $path`;
// Result: "maya.exe"
-</pre>
+```
-<br />
Strip numeric suffix
-<pre class="prettyprint lang-mel">
+
+```php
string $node = "pCube1|pCubeShape223";
string $noSuffix = `match ".*[^0-9]" $node`;
// Result: "pCube1|pCubeShape"
-</pre>
+```
-<br />
Extract numeric suffix
-<pre class="prettyprint lang-mel">
+
+```php
string $node = "pCube1|pCubeShape223";
string $suffix = `match "[0-9]+$" $node`;
// Result: "223" //
-</pre>
+```
-<br />
Extract short name of DAG or control path
-<pre class="prettyprint lang-mel">
+
+```php
string $dagPath = "pCube1|pCubeShape223";
string $shortName = `match "[^|]*$" $dagPath`;
// Result: pCubeShape223 //
-</pre>
+```
-<h2>more references</h2>
+## more references
- [https://danielfaust.github.io/ewertb/maya.html](https://danielfaust.github.io/ewertb/maya.html)