Skip to content

Commit

Permalink
remove outdated macOS and JS libraries documentation; update Azure st…
Browse files Browse the repository at this point in the history
…atic website instructions for clarity
  • Loading branch information
0xfab1 committed Jan 27, 2025
1 parent ac80210 commit af9d48c
Show file tree
Hide file tree
Showing 17 changed files with 406 additions and 366 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/tech/cloud/azure/services/static-website.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Create resources with terraform

Create a repo and create a new, emtpy terraform script to create:
Create a repo and create a new, empty terraform script to create:

- Static Website
- App Registration
Expand All @@ -15,7 +15,7 @@ Deploy terraform script to create the resources required.
## Create and deploy static website

- Create Repo for static website
- Create static websit in repo
- Create static website in repo
- Create file "staticwebapp.config.json"
- Create azure-pipelines.yml and create pipeline
- Run pipeline
Expand Down
133 changes: 99 additions & 34 deletions docs/tech/hardware/other/ulanzi_smart_pixel_clock.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,11 @@ Setup the Smart Pixel Clock e.g. WIFI password, IP of the MQTT broker (the syste

For details on the MQTT API check [this documentation](https://blueforcer.github.io/awtrix3/#/api).

Here are some examples with Mosquitto and curl:

## Control device using Mosquitto

Start mosquitto

```sh
mosquitto -v
```

Monitor MQTT topics:

```sh
mosquitto_sub -h localhost -t "awtrix/#"
```

Send a message:

```sh
mosquitto_pub -h localhost -t "awtrix/notify" -m '{"text":"Hello, Awtrix!","rainbow":true,"duration":10}'
```

Show a red arrow on the top right corner

```sh
mosquitto_pub -h localhost -t "awtrix/indicator1" -m '{"color":[255,0,0],"blink":1000}'
```

Remove the arrow again:

```sh
mosquitto_pub -h localhost -t "awtrix/indicator1" -m '{"color":[0,0,0]}'
```
Here are some examples with curl:

## Control device using Curl

Same commands as above using curl:
Some basic commands to get started:

```sh
curl -X POST --data '{"color":[0,0,0]}' -H 'Content-Type: application/json' 'http://1.2.3.4/api/indicator1'
Expand Down Expand Up @@ -181,3 +149,100 @@ Switch to a Specific App
```sh
curl -X POST --data '{"name":"Time"}' -H 'Content-Type: application/json' 'http://1.2.3.4/api/switch'
```

## Message Tool

I wrote a simple python script to write messages to a selected device:

### Prepare

Install these dependencies in your environment

```sh
pip install pyinstaller tkinter
```

### Script

This is the script named "screenmessage.py":

```sh
import tkinter as tk
import requests

def send_notification():
message = message_entry.get()
selected_ip = ip_var.get()
url = f"http://{selected_ip}/api/notify"
headers = {"Content-Type": "application/json"}
data = {"text": message, "duration": 10}

try:
response = requests.post(url, json=data, headers=headers)
if response.status_code == 200:
output_label.config(text=f"Success: {response.text}")
else:
output_label.config(text=f"Error {response.status_code}: {response.text}")
except requests.RequestException as e:
output_label.config(text=f"Request failed: {e}")

def clear_message():
# Clears the entry field and output label
message_entry.delete(0, tk.END)
output_label.config(text="")

# Create the main window
root = tk.Tk()
root.title("Notification Sender")

# Create a dropdown menu to select the IP address
ip_var = tk.StringVar(value="1.1.1.1") # Default IP
ip_options = [
("Device1", "1.1.1.1"),
("Device2", "1.1.1.2")
]
ip_label = tk.Label(root, text="Select IP Address:")
ip_label.pack(pady=5)

# Dropdown with labeled options
def update_dropdown():
menu = ip_dropdown['menu']
menu.delete(0, 'end')
for name, ip in ip_options:
menu.add_command(label=f"{name} ({ip})", command=lambda value=ip: ip_var.set(value))
ip_dropdown = tk.OptionMenu(root, ip_var, "")
ip_dropdown.pack(pady=5)
update_dropdown()

# Create a label and an entry field to input the message
message_label = tk.Label(root, text="Enter your message:")
message_label.pack(pady=5)

message_entry = tk.Entry(root, width=40)
message_entry.pack(pady=5)

# Create a button to send the notification
send_button = tk.Button(root, text="Send Notification", command=send_notification, padx=10, pady=5)
send_button.pack(pady=10)

# Create a second button to clear the message
clear_button = tk.Button(root, text="Clear Message", command=clear_message, padx=10, pady=5)
clear_button.pack(pady=10)

# Create a label to display the output
output_label = tk.Label(root, text="", wraplength=400, justify="left")
output_label.pack(pady=10)

# Start the main event loop
root.mainloop()
```
### Build
Run this command to build the executable for windows:
```sh
pyinstaller --onefile --noconsole screenmessage.py
```
The executable will be in the subfolder `dist` named `screenmessage.exe`.
18 changes: 2 additions & 16 deletions docs/tech/scripts/index.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
# Dev Overview
# Scripts

## DevOps

| OPs | Description |
|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| DevOps | Combines development and IT operation processes to make things more efficient, reliable, and secure. |
| MLOps | A data science process that involves rapid testing and deployment of machine learning models used by data scientists & MLOps engineers. |
| DataOps | Focuses on data pipelines, providing valuable insights by connecting disparate data sources and having flexible data workflows at scale. |
| AIOps | Takes place within an organization’s IT operations department in AIOps rather than the machine learning team. |
| ModelOps | is enterprise governance and operations for models in production used by the IT or Business Operations team. |
| NoOps | aims to automate IT infrastructure in a way that negates the need for an in-house team for operational purposes. In this approach, all maintenance and similar tasks of an operations team are fully automated to such a level that means no manual intervention in the process is required. |
| DevSecOps | takes the traditional DevOps approach and adds additional security checks, code verifications, and deep testing into the workflow. Rather than having security be an issue at the end of the cycle, DevSecOps integrates security from the beginning of the workflow. |
| GitOps | focuses on using Git as a way to automate the rest of the continuous delivery pipeline. With Git as the single source of truth. |
| ITOps | focuses on stability and long-term reliability instead of advocating agility and aiming for speed. (Oposite: CloudOps) |
| CloudOps | focuses on distribution, stateless, and scalability. (Oposite: ITOps) |
| CIOps | The CI system is designed to run build and tests then deploy at varying levels of sophistication according to the complexity of the pipeline. Requires CI operators or administrators to configure the IT infrastructure required to support the new codes before deployment continues |
![_is_it_worth_the_time.png](_is_it_worth_the_time.png)
5 changes: 0 additions & 5 deletions docs/tech/scripts/os/macos.md

This file was deleted.

17 changes: 9 additions & 8 deletions docs/tech/scripts/os/ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ Ubuntu is an ancient african word, meaning "I can't configure Debian".[^1]

The following is tested and used on Ubuntu 22.04.

| Ubuntu | Based on |
|-----------|-----------|
| 22.04 LTS | Debian 11 |
| 20.04 LTS | Debian 10 |
| 18.04 LTS | Debian 9 |
| 16.04 LTS | Debian 8 |
| 14.04 LTS | Debian 7 |
| 12.04 LTS | Debian 6 |
| Ubuntu Version | Code Name | Debian Version | Code Name |
|----------------|------------------|----------------|-----------|
| 24.04 LTS | Noble Numbat | Debian 13 | Trixie |
| 22.04 LTS | Jammy Jellyfish | Debian 11 | Bullseye |
| 20.04 LTS | Focal Fossa | Debian 10 | Buster |
| 18.04 LTS | Bionic Beaver | Debian 9 | Stretch |
| 16.04 LTS | Xenial Xerus | Debian 8 | Jessie |
| 14.04 LTS | Trusty Tahr | Debian 7 | Wheezy |
| 12.04 LTS | Precise Pangolin | Debian 6 | Squeeze |

## Config System

Expand Down
3 changes: 1 addition & 2 deletions docs/tech/scripts/powershell/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

Some handy code snippets for powershell :)

![_is_it_worth_the_time.png](_is_it_worth_the_time.png)

## String manipulation

- Overwrite JPEG files with MD5 hashsum: ```Get-ChildItem -Recurse -Include "*.jpg" | Get-FileHash -Algorithm MD5 | Rename-Item -NewName { $_.hash + ".jpg"} -Force```
Expand Down Expand Up @@ -479,6 +477,7 @@ Get Binding Info
- View open connections for a given service: ```get-nettcpconnection | select local*,remote*,state,@{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}} | Where-Object {$_.Process -eq "svchost"} | Format-Table```
- Check for Windows Updates: ```(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()```
- Export PowerShell command history to a file: ```Get-History | Export-CSV $env:USERPROFILE\Desktop\CommandHistory.CSV```
- Show entire history: ```Get-Content (Get-PSReadLineOption).HistorySavePath```
- Export all available powershell commands: ```Get-Command | Export-CSV $env:USERPROFILE\Desktop\CommandsAvailable.CSV```
- Get last 10 installations: ```get-wmiobject Win32_ReliabilityRecords -computername 127.0.0.1 | Select-Object -first 10 Message | format-list *```
- Last 10 security event log entries: ```Get-EventLog Security -Newest 10```
Expand Down
54 changes: 0 additions & 54 deletions docs/tech/scripts/services/timestamp.md

This file was deleted.

26 changes: 6 additions & 20 deletions docs/tech/scripts/web/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,26 +278,12 @@ ASCII Boarder

## JavaScript

``` txt
JSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJS
JSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJS
JSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJS
JSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJS
JSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJS
JSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJS
JSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJS
JSJSJSJSJSJSJSJSJ SJSJS JSJSJS
JSJSJSJSJSJSJSJSJ SJS JSJS
JSJSJSJSJSJSJSJSJ SJS JSJSJSJSJ
JSJSJSJSJSJSJSJSJ SJSJ SJSJSJSJ
JSJSJSJSJSJSJSJSJ SJSJSJ SJSJSJ
JSJSJSJSJSJSJSJSJ SJSJSJSJ JSJS
JSJSJSJSJSJSJSJSJ SJSJSJSJS JSJ
JSJSJSJSJS JS JSJS JSJ
JSJSJSJSJSJ SJSJSJ SJSJS
JSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJS
JSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJSJS
```
![javascript](_javascript.jpg)

## Cool JS libraries

- d3.js: <https://threejs.org/>
- three.js: <https://d3js.org/>

### Keylogger

Expand Down
Loading

0 comments on commit af9d48c

Please sign in to comment.