This file contains hidden or 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 socket | |
| import time | |
| from umodbus import conf | |
| from umodbus.client import tcp | |
| # Adjust modbus configuration | |
| conf.SIGNED_VALUES = True | |
| # Create a socket connection | |
| sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| using Oxide.Core; | |
| using Oxide.Core.Configuration; | |
| using Oxide.Core.Libraries.Covalence; | |
| namespace Oxide.Plugins | |
| { | |
| [Info("TeleportToBase", "booletic", "1.0.0")] | |
| [Description("Teleports a player back to their base")] |
This file contains hidden or 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
| # Mansoor Aldosari (aldosari.medium.com) | |
| # Detect A Webpage Using Entropy | |
| # Requirements: | |
| # 1. numpy==1.23.0 | |
| # 2. pandas==1.3.5 | |
| # 3. scipy==1.6.3 | |
| from scipy.stats import entropy | |
| import requests | |
| from time import sleep |
This file contains hidden or 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/bash | |
| for i in * .*; | |
| do | |
| if [ "$i" != "." -a "$i" != ".." ]; | |
| then | |
| echo -n "$i :" | |
| ent $i | grep 'by [0-9]* percent' | |
| fi | |
| done |
This file contains hidden or 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
| <Sysmon schemaversion="4.81"> | |
| <EventFiltering> | |
| <ProcessCreate onmatch="include" /> | |
| <ProcessTerminate onmatch="include" /> | |
| <NetworkConnect onmatch="include"> | |
| <SourcePort name="RustSRV" condition="is">28015</SourcePort> | |
| <SourcePort name="RustRcon" condition="is">28016</SourcePort> | |
| <SourcePort name="RustPlus" condition="is">28083</SourcePort> | |
| </NetworkConnect> | |
| </EventFiltering> |
This file contains hidden or 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
| # switch between steam accounts seamlessly | |
| # created on 2022-07 by Mansoor Aldosari | |
| $username = Read-Host "Enter Steam Username" | |
| $steam = Get-Process steam -ErrorAction SilentlyContinue | |
| if ($steam) { | |
| $steam | Stop-Process | |
| } |
This file contains hidden or 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
| function Counter () | |
| local count = 0 | |
| return function () | |
| count = count + 1 | |
| return count | |
| end | |
| end | |
| local counter = Counter() |
This file contains hidden or 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 Counter(): | |
| count = 0 | |
| def increment(): | |
| nonlocal count | |
| count += 1 | |
| return count | |
| return increment | |
| counter = Counter() |
This file contains hidden or 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
| class Counter: | |
| def __init__(self): | |
| self.count = 0 | |
| def __call__(self): | |
| self.count += 1 | |
| return self.count | |
| counter = Counter() |
This file contains hidden or 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 numpy as np | |
| x_train = np.array([[-40.], [-30], [-20], [-10], [0], [10], [20], [30], [40]])/100 | |
| y_train = np.array([31.28, 31.46, 31.64, 31.82, 32., 32.18, 32.36, 32.54, 32.72]) | |
| def forward(w, x, b): return np.float(w*x+b) | |
| def backward(x, y, pred, dw, db): | |
| dw = dw + (-2)*x*(y-pred) | |
| db = db + (-2)*(y-pred) |
NewerOlder