Page not found :(
The page you are looking for doesn't exist or has been moved.
diff --git a/functions/hi-from-lambda.js b/functions/hi-from-lambda.js new file mode 100644 index 0000000..194e04e --- /dev/null +++ b/functions/hi-from-lambda.js @@ -0,0 +1 @@ +!function(e,t){for(var n in t)e[n]=t[n]}(exports,function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){t.handler=(e,t,n)=>{n(null,{statusCode:200,headers:{"Content-Type":"application/json"},body:JSON.stringify({message:"Hi from Lambda."})})}}])); \ No newline at end of file diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000..8993650 --- /dev/null +++ b/public/404.html @@ -0,0 +1,4 @@ +
The page you are looking for doesn't exist or has been moved.
AdvMake uses Starlark as the format for its build files. +Modules are also defined for both convenience and extra functionality.
Starlark is a Python-like language meant for configuration files.
Build files are by default called AdvMakefile, but that can be set via -f
An AdvMakefile example can be found at AdvMake’s repo as it uses AdvMake itself.
AdvMake runs functions exposed by starlark in the format <name>_<target>.
+To set the default name and target, the global variables defaultName, and defaultTarget must be set.
+Here is an example from AdvMake’s AdvMakefile:
defaultName = "advmake"
+defaultTarget = "build"
+This will tell AdvMake to run the function advmake_build() when run with no arguments.
If AdvMake is run with one argument (such as advmake install), it will use the default name with the specified target,
+so in that case, it would run advmake_install().
If run with two arguments, AdvMake will use the first argument as the name and the second as the target.
+So, running advmake hello world would run the function hello_world().
As previously mentioned, AdvMake comes with modules. Those are as follows:
runtimeThe runtime module exposes some of golang’s runtime methods and variables.
runtime.GOOSStores a string denoting the operating system being used.
+Godocruntime.GOARCHStores a string denoting the CPU architecture being used.
+Godocruntime.NumCPU()Get the number of logical CPUs available to the current process
+Godocruntime.GOMAXPROCS()Definition: runtime.GOMAXPROCS(n)
Get or set the value of the GOMAXPROCS environment variable. This variable controls the maximum number of CPUs that can execute. This function will set GOMAXPROCS to n and then return the previous value. If n<1, this function will not set the variable and will instead return the current setting
encodingThe strings module contains functions for encoding and decoding various formats. This module contains submodules for the various formats
Available submodules:
JsonYamlTomlHexencoding.<Submodule>.Load()Load a string formatted as the submodule format into a dictionary or string.
Examples:
x = encoding.Json.Load('{"encoding": "json"}')
+# x["encoding"] == "json"
+y = encoding.Hex.Load('546573740a')
+# y == "Test"
+encoding.<Submodule>.Dump()Dump a string formatted as the submodule format from a dictionary or string
Examples:
xDict = {"encoding": {"type": "toml"}}
+x = encoding.Toml.Dump(xDict)
+# x == '''
+#
+# [encoding]
+# type = "toml"
+#
+# '''
+y = encoding.Hex.Dump("Test")
+# y = "546573740a"
+fileThe file module contains functions for manipulation and checking of files
file.Expand()Definition: file.Expand(file, mappings)
Expand any instances of $VAR in a file according to provided mappings.
Examples:
file.txt before:
I am running on $OS and architecture $arch
+Code:
file.Expand("file.txt", {"OS": runtime.GOOS, "arch": runtime.GOARCH})
+file.txt after:
I am running on linux and architecture x86_64
+file.Exists()Definition: file.Exists(filepath)
Check whether a file exists
Example:
file.Exists("/etc/fstab") # True
+file.Content()Definition: file.Content(filepath)
Returns contents of a file as a string
Example:
file.txt:
This is a file
+Code:
file.Content("file.txt") # "This is a file"
+stringsThe strings module contains functions for the manipulation of strings
strings.Regex()Definition: strings.Regex(string, pattern, regex)
Parse a string using a regular expression and return the result in the specified format.
Examples:
x = strings.Regex("Hello, World", "$2, $1", "(.+), (.+)")
+# x == "World, Hello"
+y = strings.Regex("Hello, World", "$y, $x", "(?P<x>.+), (?P<y>.+)")
+# y == "World, Hello"
+z = strings.Regex("Hello, World", "$match, $2, $1", "(.+), (.+)")
+# z == "Hello, World, World, Hello"
+strings.HasSuffix()Definition: strings.HasSuffix(string, suffix)
Check whether a string ends with a suffix.
Examples:
strings.HasSuffix("doc.pdf", ".pdf") # True
+strings.HasSuffix("doc.pdf", ".md") # False
+strings.HasPrefix()Definition: strings.HasPrefix(string, prefix)
Check whether a string starts with a prefix.
Example:
strings.HasPrefix("doc.pdf", "doc") # True
+strings.TrimSuffix()Definition: strings.HasSuffix(string, suffix)
Remove suffix from string if it exists. If it does not exist, the string is returned unchanged.
Example:
strings.TrimSuffix("doc.pdf", ".pdf") # "doc"
+strings.TrimPrefix()Definition: strings.TrimPrefix(string, prefix)
Remove prefix from string if it exists. If it does not exist, the string is returned unchanged.
Example:
strings.TrimPrefix("doc.pdf", "doc") # ".pdf"
+strings.TrimSpace()Definition: strings.TrimSpace(string)
Trim leading and trailing white space, as defined by Unicode
Example:
strings.TrimSpace(" Hi ") # "Hi"
+inputThe input module prompts the user for input
input.Prompt()Definition: input.Prompt(prompt)
Print prompt and wait for input, returning on newline
Example:
input.Prompt("Enter number: ")
+input.Choice()Definition: input.Choice(prompt, choices)
Assign number to each choice and prompt user to choose one
Example:
input.Choice("Choose greeting", ["Hi", "Hello", "Good morning"])
+The above example looks like this to the user:
[1] "Hi"
+[2] "Hello"
+[3] "Good Morning"
+Choose greeting:
+When the user chooses a number, the function will return the associated string. So, if the user chooses 1, "Hi" will be returned.
urlThe url module contains functions for the manipulation of URLs
url.Parse()Definition: url.Parse(urlString)
Parses a URL and returns its components
Example:
parsed = url.Parse("https://www.arsenm.dev/docs/advmake/build-files")
+# parsed.Scheme == "https"
+# parsed.Host == "www.arsenm.dev"
+# parsed.Path == "/docs/advmake/build-files"
+shellThe shell module contains functions for accessing and utilizing the shell.
shell.Exec()Definition: shell.Exec(command, output?, concurrent?)
Runs a command or script using sh -c, sending the output to STDOUT and returning it unless set otherwise. It can also be concurrent.
Examples:
Code:
x = shell.Exec("date +%r") # "12:00:00 AM"
+y = shell.Exec("date +%r", output='return') # "12:00:00 AM"
+z = shell.Exec("date +%r | base64", output='stdout') # None
+shell.Exec("""
+ sleep 1
+ sleep 2
+""", concurrent=True) # Sleeps for two seconds
+STDOUT:
12:00:00 AM
+MTI6MDA6MDAgQU0K
+shell.Getenv()Definition: shell.Getenv(key)
Returns the value of an environment variable
Example:
shell.Getenv('TERM') # "xterm"
+shell.Setenv()Definition: shell.Setenv(key, value, onlyIfUnset?)
Sets the value of an environment variable. It can be configured not to set the value if it is already set
Examples:
shell.Setenv("X", "x") # $X = x
+shell.Setenv("CC", "gcc") # if $CC unset, $CC = gcc
+shell.LookPath()Definition: shell.LookPath(command)
Returns the path to the executable of the specified command. Returns -1 if the command is not found in PATH.
Examples:
shell.LookPath('sh') # "/bin/sh"
+shell.LookPath('nonExistentCommand') # -1
+netThe net module contains various network functions
net.Download()Download a file from a URL, optionally specifying the filename. It will show progress if the Content-Length header is present.
Examples:
net.Download("https://minio.arsenm.dev/advmake/0.0.1/advmake-linux-x86_64")
+net.Download("https://minio.arsenm.dev/advmake/0.0.1/advmake-linux-x86_64", filename="advmake")
+logThe log module contains functions to log events at various levels
The available levels are:
InfoDebugWarnFatallog.<Level>()Definition: log.<Level>(message)
Logs a message at the specified level. The fatal level quits after logging the message.
Examples:
log.Info("Test log")
+log.Fatal("Error")
+fmtThe fmt module exposes all the text functions from the golang fmt package except for all the Fprint and Fscan functions.
fmt.Sprintf("Print %s string", "formatted") # "Print formatted string"
+⇐ Docs
AdvMake is hosted on my Gitea instance. If that is down, it is also mirrored on Gitlab.
To download AdvMake, you can either use the download button on Gitea or Gitlab, or +you can use the git CLI
To clone AdvMake using the CLI, run one of the following commands:
git clone https://gitea.arsenm.dev/Arsen6331/advmake.git
+OR
+git clone https://gitlab.com/moussaelianarsen/advmake.git
+AdvMake is written in Go. This means go must be installed on your computer. Most
+linux distros call the package that provides it either go or golang.
Once go is installed, you can check that it runs by running
go version
+To compile AdvMake, run
go build
+To install AdvMake, run:
sudo install -Dm755 advmake /usr/bin
+Once the command completes, AdvMake should be ready and you can run the following to make sure it works:
advmake -h
+⇐ Docs
KbdEmu uses continuous integration to compile. You can find the binary by +clicking the CI badge above, selecting “Ubuntu2004” for the linux build or +“macOS” for the macOS build, and then going to the artifacts tab.
KbdEmu is hosted in two places, Gitea and Gitlab. Either one can be used as +it is mirrored from Gitea to Gitlab
To download kbdemu, you can either use the download button on one of the above, or +you can use the git command
To clone kbdemu using the command, run one of the following commands:
git clone https://gitea.arsenm.dev/Arsen6331/kbdemu
+OR
+git clone https://gitlab.com/moussaelianarsen/kbdemu
+Now, you will want to cd into the root of this repo before completing the rest
+of these instructions
Since KbdEmu is written in go, you will need go installed in order to compile it.
+Most linux distros call the package providing it either go or golang.
Once go is installed, you can check that it runs by running
go version
+To compile KbdEmu, run the following commands:
go get github.com/go-vgo/robotgo
+go get github.com/BurntSushi/toml
+go get github.com/rs/zerolog/log
+source .envrc
+go build
+To install kbdemu, run the following command:
sudo install -Dm755 kbdemu /usr/bin
+Once this command completes, to test whether kbdemu was installed properly, run +this command:
kbdemu
+You should get an error warning you that kbdemu cannot find a TOML file. If you do, +kbdemu is properly installed.
This page assumes you have already installed KbdEmu. If not, follow the installation instructions on the installation page:
InstallationKbdEmu uses scpt as its scripting language. The example script for kbdemu looks like this:
set testKey to "x"
+keystroke $testKey with action "hold"
+sleep "1s"
+keystroke $testKey with action "release"
+type "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz"
+scroll 5 with direction "up"
+click "right"
+move-mouse [0, 0]
+send-notification "Test"
+beep
+open-location "https://www.arsenm.dev/"
+set showDetails to (display-dialog "Show details?" with type "yesno")
+if $showDetails {
+ display-dialog {"Color: " + (pixel-color [100, 100]) + ", Mouse: " + (str (mouse-position))} with title "Details"
+}
+print {"\n" + (user-choice "test" with items ["Hello", "World", 3.1415926535, $GOOS, $GOARCH, true, false, (numcpu)])}
+log "Complete!"
+By default, the kbdemu command will look for and execute a file called kbdemu.scpt, but that can be changed using the --file flag.
KbdEmu comes with some extra functions for automation
numcpuReturns the amount of available CPUs as a number.
Example:
print (numcpu)
+sleepSleeps for a duration as specified by an unnamed string argument formatted according to the specification of golang’s time.ParseDuration():
Examples:
sleep "1s"
+sleep "1h2m"
+display-dialogDisplays a dialog window with the specified parameters.
Examples:
display-dialog "Test1"
+display-dialog "Test2" with title "Title Test"
+print (display-dialog "Test3" with title "Entry Test" with type "entry")
+These are all the supported dialog types:
Default dialog type is info.
send-notificationSends a notification according to the specified parameters
Examples:
send-notification "Test"
+send-notification "Test" with title "Title"
+send-notification "Test" with title "Title" with icon "test.png"
+beepCreates a beep sound, if impossible, falls back to sending bell character.
Examples:
beep
+beep "3s"
+clickEmulates a mouse click
Example:
click "right"
+scrollScrolls the specifed amount in the specified direction
Example:
scroll 5 with direction "up"
+move-mouseMoves the cursor to the specified coordinates
Example:
move-mouse [100, 200]
+keystrokeEmulates a key event
Examples:
keystroke "y" with action "hold"
+sleep "2s"
+keystroke "y" with action "release"
+keystroke "x"
+Default action is tap which presses and releases the key.
typeTypes a string using the keyboard
Example:
type "Hello, World"
+mouse-positionReturns the current mouse position in the form of an array containing two number elements.
Example:
print (mouse-position) # [0 0]
+pixel-colorReturns a string containing the hex color of the given coordinates.
Example:
print (pixel-color [100, 100]) # ffffff
+logLogs the provided message at the given level.
Examples:
log "Complete"
+log "Error" with level "fatal"
+The available levels are:
Default log level is info
user-choiceDisplays a user choice dialog window with provided items, returns selected item.
Example:
user-choice "Choose an option" with items ["Hello", "World", 1, 3.14159, 6.28318]
+open-locationOpens given URL in the default application set to open it.
Examples:
open-location "https://www.arsenm.dev"
+open-location "/home"
+KbdEmu exposes some variables for use in scripts.
$GOOSThe value from golang’s runtime.GOOS
$GOARCHThe value from golang’s runtime.GOARCH
$argumentsNon-flag command line arguments provided to KbdEmu
Example:
Command:
kbdemu --file script.scpt "Hello, World"
+Contents of script.scpt:
print $arguments[0] # Hello, World
+This page assumes you have already installed Opensend. If not, follow the installation +instructions on the installation page.
InstallationOpensend GUI has been written in golang using fyne. Its source code can be found here:
Opensend GUITo download Opensend GUI, run the following command
git clone https://gitea.arsenm.dev/opensend/opensend-gui.git
+To build Opensend GUI, go must be installed. The process for that is explained in the installation instructions for Opensend. Once go is installed, run:
go build
+This may take a while as go downloads and compiles Opensend GUI and Fyne.
Once the build is complete, there should be a file named opensend-gui in the directory. Run this file to open the GUI which should look like this:

⇐ Docs
Opensend uses continuous integration to compile. You can find the binary by clicking the download binary badge above.
Opensend is hosted on Gitea.
To download opensend, you can either use the download button on one of the above, or +you can use the git command
To clone opensend using the command, run the following command:
git clone https://gitea.arsenm.dev/opensend/opensend.git
+Now, you will want to cd into the root of this repo before completing the rest
+of these instructions
Since Opensend is written in go, you will need go installed in order to compile it.
+Most linux distros call the package providing it either go or golang.
Once go is installed, you can check that it runs by running
go version
+To compile Opensend, run the following command:
make
+To install opensend, run one of the following commands:
sudo make install # Linux
+sudo make install-macos # macOS
+Once this command completes, to test whether opensend was installed properly, run +this command:
opensend -h
+You should get the usage for opensend.
This page assumes you have already installed Opensend. If not, follow the installation +instructions on the installation page.
InstallationOpensend allows configuration by TOML and by command line flags. It looks at the following paths for configs in the specified order:
--config flag~/.config/opensend.toml/etc/opensend.tomlUsage of opensend:
+ -d string
+ Data to send
+ -dest-dir string
+ Destination directory for files or dirs sent over opensend (default "/home/arsen/Downloads")
+ -r Receive data
+ -s Send data
+ -send-to string
+ Use IP address of receiver instead of mDNS
+ -skip-mdns
+ Skip zeroconf service registration (use if mdns fails)
+ -t string
+ Type of data being sent
+The purpose of the mdns-skipping flags is to account for the iSH app in iOS, as the mdns resolver and registration fails on it.
Pak uses a custom config file at /etc/pak.cfg. For example, this is what the
+apt config looks like:
# Write the name of the package manager in all lowercase below
+apt
+# Write a comma separated list of commands from the manager below
+install,remove,update,upgrade,search,download
+# Write "yes" or "no" depending on whether you want to use root
+yes
+# Write command to use for root
+sudo
+# Write a comma separated list of shortcuts below
+rm,inst
+# Write a comma separated list of shortcut mappings from the manager below
+remove,install
+
+This file is read by pak to tell it what to do. The comments above each keyword +explain what it’s for.
Here is a list of all the fields and their uses:
sudo, doas, etc.)Once you have made the config, just place it at /etc/pak.cfg and pak will
+automatically use it.
Pak uses continuous integration to compile. You can find the binary by clicking the download badge above.
If you are running an arch-based linux distro, you can use the Arch User Repository
+to install pak. First, make sure the yay AUR helper is installed, then run the following:
yay -S pak
+Pak is hosted on my Gitea instance. If that is down, it is also mirrored on Gitlab.
To download pak, you can either use the download button on Gitea or Gitlab, or +you can use the git CLI
To clone pak using the CLI, run one of the following commands:
git clone https://gitea.arsenm.dev/Arsen6331/pak
+OR
+git clone https://gitlab.com/moussaelianarsen/pak
+Pak is written in Go. This means go must be installed on your computer. Most
+linux distros call the package that provides it either go or golang.
Once go is installed, you can check that it runs by running
go version
+To compile pak, run
make
+Then, you will need to figure out which package manager you have. Here is a list +of package managers with ready to use configs:
If your package manager is not in the list, you can make a config for it. Go to +the Configuration page for more information.
If your package manager is in the list, use one of these:
sudo make aptinstallsudo make aptitudesudo make brewinstallsudo make yayinstallsudo make pacinstallsudo make zyppinstallsudo make snapinstallsudo make installbinonlyOnce the command completes, unless you’re using a custom config, pak should be ready +and you can run the following to make sure it works:
pak
+Go to the Configuration page for instructions on making a custom config, you must +have a config for pak to function.
Using pak is simple, just run pak and one of the commands from the config file.
+Pak understands partial commands, so these commands will be identical:
pak in <package>
+OR
+pak inst <package>
+OR
+pak install <package>
+The lack of sudo is intentional. Pak will not allow running from root by default
+as it already invokes root internally. To bypass this, simply give pak the -r flag.
Using shortcuts in pak is just as simple as commands, just run pak and a shortcut,
+like this:
pak rm <package>
+Simpledash can be run using the simpledash binary directly, or for convenience, using advmake run.
If using the binary directly, the listen IP, port, etc. can be configured via flags.
This is the help screen of simpledash:
Usage of ./simpledash:
+ -a, --addr ip Bind address for HTTP server (default 0.0.0.0)
+ -c, --config string TOML config file (default "simpledash.toml")
+ --hash string Generate new bcrypt password hash
+ -p, --port int Bind port for HTTP server (default 8080)
+simpledash: help requested
+The default address of simpledash is 0.0.0.0:8080 meaning any origin IP on any interface, port 8080.
The --hash option creates a suitable bcrypt password hash for use in the config, prints it, and exits.
Simpledash is configured using a TOML configuration file (simpledash.toml by default). It contains the users, cards, etc.
An example file is provided in the simpledash repository. It contains examples of all the card types in simpledash.
This is the example:
title = "SimpleDash"
+theme = "dark"
+loginRequired = false
+allowProxy = ["https://www.metaweather.com/", "https://ifconfig.co/json"]
+
+[session]
+ name = "simpledash-session"
+
+[users]
+ [[users._public_.card]]
+ type = "weather"
+ title = "Weather"
+ data = {"woeid" = "2442047"}
+
+ [[users._public_.card]]
+ type = "api"
+ title = "Server IP (API card example)"
+ url = "https://ifconfig.co/json"
+ data = {"format" = """
+ <p class="subtitle">${data.ip}</p>
+ Country: ${data.country} (${data.country_iso})
+ Time zone: ${data.time_zone}
+ """}
+
+ [users.admin]
+ passwordHash = "$2a$10$w00dzQ1PP6nwXLhuzV2pFOUU6m8bcZXtDX3UVxpOYq3fTSwVMqPge"
+ showPublic = true
+
+ [[users.admin.card]]
+ type = "status"
+ title = "Google"
+ icon = "ion:logo-google"
+ desc = "Google search engine. Status card example."
+ url = "https://www.google.com"
+
+ [[users.admin.card]]
+ type = "simple"
+ title = "Gmail"
+ icon = "simple-icons:gmail"
+ desc = "Gmail mail client. Simple card example"
+ url = "https://mail.google.com/"
+
+ [[users.admin.card]]
+ type = "collection"
+ title = "Programming"
+ icon = "entypo:code"
+ [users.admin.card.data]
+ Godoc = {"url" = "https://pkg.go.dev", "target" = "newTab"}
+ Ruby-Doc = {"url" = "https://ruby-doc.org/", "target" = "sameTab"}
+
+ [[users.admin.card]]
+ type = "collection"
+ title = "Science"
+ icon = "ic:outline-science"
+ data = {"Google Scholar" = {"url" = "https://scholar.google.com/", "target" = "sameTab"}}
+The title field sets the name of the website which will be used in all mentions including title tags and headers.
The theme can either be dark or light. The dark theme was generated using darkreader.
The loginRequired field denotes whether login is required to view the dashboard. If false, public cards will be viewable without logging in.
The session section contains one field, name. This field is the name of the session cookie set in the browser upon visiting simpledash.
The users section contains all users and their associated cards. A user can be defined like so:
[users.admin]
+ passwordHash = "$2a$10$w00dzQ1PP6nwXLhuzV2pFOUU6m8bcZXtDX3UVxpOYq3fTSwVMqPge"
+ showPublic = true
+The passwordHash field contains a hash as created by the --hash flag.
The showPublic field is a boolean denoting whether to show public cards as well when logged in.
Cards reside under their respective user in the config file. A card can be defined like so:
[[users.admin.card]]
+ type = "status"
+ title = "Google"
+ icon = "ion:logo-google"
+ desc = "Google search engine. Status card example."
+ url = "https://www.google.com"
+The cards contain various fields, some required, some not:
type: The type of the card. (required)title: The title of the card to be used in the header. (required)icon: The icon to be used in various places depending on the card. Icons can be anything from iconify.desc: The description of the card’s content.url: The URL of the card to be used for various purposes depending on the card.data: A dictionary containing any extra data not listed above.Card types can be added simply by adding a file to resources/templates/cards. The name of the file will be used as the name of the card type
⇐ Docs
Simpledash utilizes an SQLite database for session storage. That means that sqlite3 must be installed along with its development files to build simpledash. It also means cross-compilation is not as simple as setting some environment variables.
On Debian, the required packages are: sqlite3 and sqlite3-dev.
On Arch, the required package is sqlite.
To build simpledash, first, clone the git repository of simpledash. Then, use a terminal to enter the cloned directory and run:
go build
+Simpledash can be built with another of my projects, advmake. Using this also builds the CSS framework used in this project, Bulma.
To build simpledash using advmake, simply run:
advmake
+To run via advmake, run:
advmake run
+simpledash.toml. Passwords are stored as bcrypt hashes.