This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<masters> | |
<master idx="0" appTimePeriod="1000000" refClockSyncCycles="-1" name="master0"> | |
<slave idx="0" type="EK1110" /> | |
<slave idx="1" type="R88D-1SN01H-ECT" name="x-servo"> | |
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"/> | |
<watchdog divider="2498" intervals="1000"/> | |
</slave> | |
<slave idx="2" type="R88D-1SN01H-ECT" name="y-servo"> | |
<dcConf assignActivate="300" sync0Cycle="*1" sync0Shift="0"/> | |
<watchdog divider="2498" intervals="1000"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Implementation of the Datamodel for the parts list with natural sort.""" | |
import re | |
import wx | |
import wx.dataview as dv | |
BOM_COL = 6 | |
POS_COL = 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wx | |
import wx.dataview as dv | |
from datamodel import PartListDataModel | |
import random | |
class MyFrame(wx.Frame): | |
def __init__(self): | |
wx.Frame.__init__(self, None, title="DataViewCtrl Example with Natural Sort") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wx | |
import wx.dataview as dv | |
import re | |
import random | |
def natural_sort_key(s): | |
"""Return a tuple that can be used for natural sorting.""" | |
return [ | |
int(text) if text.isdigit() else text.lower() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See https://cdn.sick.com/media/docs/6/86/086/Operating_instructions_Flexi_Soft_Gateways_in_the_Safety_Designer_Configuration_software_de_IM0081086.PDF | |
# Page 36 | |
from pymodbus.client import ModbusTcpClient as ModbusClient | |
IP = "192.168.255.3" | |
PORT = 502 | |
ADDRESS = 1100 | |
REGISTERS = 25 | |
SLAVE_ID = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
NEW_HOST=new_server | |
TARGET_FOLDER=/opt/docker/cloud/transfer/ | |
MYSQL_USER=nextcloud | |
MYSQL_PW=my_secure_db_pw | |
DATE=`date +"%Y%m%d"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$files = Get-ChildItem -Name ./*.svg | |
for ($i=0; $i -lt $files.Count; $i++) { | |
$newname = ([String]$files[$i]).Replace("svg","pdf") | |
& "C:\Program Files\Inkscape\bin\inkscape.exe" --actions="export-type:pdf;export-do" --export-filename=$newname $files[$i] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rainbow_color_stops(n=10, end=2 / 3): | |
rgb = [hls_to_rgb(end * i / (n - 1), 0.5, 1) for i in range(n)] | |
hex = [f"#{int(255.0*r):02x}{int(255.0*g):02x}{int(255.0*b):02x}" for r, g, b in rgb] | |
return hex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from subprocess import Popen, PIPE | |
from datetime import datetime as dt | |
import json | |
occ = ["docker-compose", "exec", "-u", "www-data", "app", "/var/www/html/occ"] | |
list_users_cmd = occ + ["user:list", "--output=json"] | |
with Popen(list_users_cmd, stdout=PIPE) as proc: | |
users = json.loads(proc.stdout.read().decode("UTF-8")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
case $1 in | |
"update" ) | |
docker-compose $(find . -maxdepth 2 -name compose.*.yaml -type f -print | sed -e 's/^/-f /') pull --ignore-pull-failures && \ | |
docker-compose $(find . -maxdepth 2 -name compose.*.yaml -type f -print | sed -e 's/^/-f /') up -d;; | |
"status" ) | |
docker-compose $(find . -maxdepth 2 -name compose.*.yaml -type f -print | sed -e 's/^/-f /') ps -a;; | |
"lf" ) | |
docker-compose $(find . -maxdepth 2 -name compose.*.yaml -type f -print | sed -e 's/^/-f /') logs -f ${@:2};; |
NewerOlder