Skip to content

Instantly share code, notes, and snippets.

View nazwadi's full-sized avatar
💭
Caffeinating...

Nazwadi nazwadi

💭
Caffeinating...
  • United States
View GitHub Profile
UPDATE npc_types nt
SET nt.aggroradius=100
WHERE nt.aggroradius=120
AND nt.id IN (SELECT DISTINCT s2.npcID FROM spawn2 sp
INNER JOIN spawngroup s ON sp.spawngroupID = s.id
INNER JOIN spawnentry s2 ON s2.spawngroupID = s.id
INNER JOIN npc_types n ON n.id = s2.npcID
WHERE sp.zone = 'sebilis')
SELECT DISTINCT s2.npcID, n.id, n.name, n.MR from spawn2 sp
INNER JOIN spawngroup s ON sp.spawngroupID = s.id
INNER JOIN spawnentry s2 ON s2.spawngroupID = s.id
INNER JOIN npc_types n ON n.id = s2.npcID
WHERE sp.zone = 'sebilis';
@nazwadi
nazwadi / soulbound.pl
Last active January 18, 2023 05:29
Create soulbound keys (EQEMU scripts)
# place this script in quests/global/global_player.pl
sub EVENT_DEATH_COMPLETE {
@keyIds = (20883);
my $corpse = $entity_list->GetCorpseByOwner($client);
foreach(@keyIds) {
if ($corpse->HasItem($_)) {
$corpse->RemoveItemByID($_);
quest::summonitem($_);
}
@nazwadi
nazwadi / llvm_template.cpp
Created April 9, 2019 18:22
LLVM_Template - modified slightly from the example in http://llvm.org/docs/ProgrammersManual.html
// From http://llvm.org/docs/ProgrammersManual.html
#include "llvm/Pass.h"
#include "llvm/IR/Function.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
namespace {
struct Hello : public FunctionPass {
static char ID;
@nazwadi
nazwadi / simplewebserver.ps1
Created November 24, 2016 04:40
Another basic powershell webserver
function Invoke-Webserver {
Param(
[Parameter(Mandatory=$True)]
[string]$port,
[Parameter(Mandatory=$True)]
[string]$ip
)
$httpd = New-Object Net.HttpListener
$httpd.Prefixes.Add("http://"+$ip+":"+$port+"/")
@nazwadi
nazwadi / webserver.ps1
Created November 24, 2016 04:35
**Simple** Powershell Webserver
function Load-Packages
{
param ([string] $directory = 'Packages')
$assemblies = Get-ChildItem $directory -Recurse -Filter '*.dll' | Select -Expand FullName
foreach ($assembly in $assemblies) { [System.Reflection.Assembly]::LoadFrom($assembly) }
}
Load-Packages
$routes = @{
@nazwadi
nazwadi / xml_to_csv.ps1
Created November 24, 2016 04:31
Powershell Convert XML to CSV
[xml]$books = Get-Content .\books.xml
$books.library.book | % {$_.title}
$books.library.book | % {$_.title} | ? { $_ -match 'starfish' }
$books.library.book | Export-Csv "books.csv" -NoTypeInformation -Delimiter:"," -Encoding:UTF8
@nazwadi
nazwadi / NotifyIcon.ps1
Created November 24, 2016 04:30
Windows Display Notify Icon (Toast)
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
$objNotifyIcon = New-Object System.Windows.Forms.NotifyIcon
$objNotifyIcon.Icon = "C:\Users\Nathan\registry.ico"
$objNotifyIcon.BalloonTipIcon = "Error"
$objNotifyIcon.BalloonTipText = "A change has been detected in your registry autostart keys."
$objNotifyIcon.BalloonTipTitle = "Autostart Registry Key Added"
$objNotifyIcon.Visible = $True
@nazwadi
nazwadi / LocalSystemInformation.ps1
Created November 24, 2016 04:28
Windows - Print Local System Information
$computerSystem = Get-CimInstance CIM_ComputerSystem
$computerBIOS = Get-CimInstance CIM_BIOSElement
$computerOS = Get-CimInstance CIM_OperatingSystem
$computerCPU = Get-CimInstance CIM_Processor
$computerHDD = Get-CimInstance Win32_LogicalDisk -Filter "DeviceID = 'C:'"
Clear-Host
Write-Host "System Information for: " $computerSystem.Name -BackgroundColor DarkCyan
"Manufacturer: " + $computerSystem.Manufacturer
"Model: " + $computerSystem.Model
@nazwadi
nazwadi / python_bash_font
Created September 23, 2015 23:51
Bash Colors in Python
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'