Skip to content

Instantly share code, notes, and snippets.

View D4R4's full-sized avatar

Dara Ardalan D4R4

  • SCALINX
  • Paris, France
View GitHub Profile
@D4R4
D4R4 / veeam_registry
Created September 21, 2019 19:05
For Veeam backup & Replication, These keys should be modified with the new Computer Name in case it changes after installation
HKLM\SOFTWARE\Veeam\Veeam Backup and Replication\SqlServerName
HKLM\SOFTWARE\Veeam\Veeam Backup Catalog\CatalogSharedFolderPath
@D4R4
D4R4 / perl_sms_ir.cgi
Created September 28, 2019 12:09
CGI Perl script to use POST and RESTful client and connect to SMS IR
#!/usr/bin/perl -X
use lib '.';
use strict;
use CGI::Carp qw(fatalsToBrowser);
use REST::Client;
use JSON;
@D4R4
D4R4 / ping_sweep.cisco
Last active October 13, 2019 15:53
Ping sweep on Cisco IOS, usefull to fill ARP table
R1#tclsh
R1(tcl)#for {set i 1} {$i < 31} {incr i} { ping 192.168.0.$i repeat 1 timeout 1 }
@D4R4
D4R4 / photoshop.jsx
Created October 28, 2019 09:18
Script to convert all guides to strokes with specific color and stroke size in Photoshop
//Requires Photoshop CS5 or newer
#target photoshop;
if(documents.length) app.activeDocument.suspendHistory('Stroke Guides', 'main()');
function main(){
activeDocument.artLayers.add();
@D4R4
D4R4 / Observium_Pushover
Created March 31, 2020 20:28
Observium script to send alarm push notifications to Pushover API
#!/bin/bash
#
#
OBS_PATH="https://xxxxxxxxx.xxx"
OBS_USER=xxxxxxxxxxx
OBS_PASS=xxxxxxxxxxxx
OBS_DEVICE_NO=5
OBS_GRAPH_NAME=device_la
@D4R4
D4R4 / l2tp_vpn_client
Created June 10, 2020 15:45
L2TP VPN Client setup on CentOS 7
Go step-by-step through following instructions to set up L2TP/IPSec VPN on Centos 7.
To set up the VPN client on centos 7, first install the following packages:
yum -y install epel-release
yum -y install strongswan xl2tpd
Create VPN variables (replace with actual values):
VPN_SERVER_IP='your_vpn_server_ip'
@D4R4
D4R4 / LDAPModify
Created June 24, 2020 08:49
LDAP Modify command example on a local OpenLDAP server where there is no slapd.conf
ldapmodify -Y EXTERNAL -H ldapi:/// -D "cn=admin,dc=example,dc=net" -W -f /root/ldap_modify/change_sasl.ldif
@D4R4
D4R4 / send_sms_readme
Created July 30, 2020 22:29
Send SMS on RDP login - using TextMagic Email2SMS service, Event Viewer
Logon refers to an RDP logon to the system, an event that appears after a user has been successfully authenticated. It is an event with the EventID 21 (Remote Desktop Services: Session logon succeeded). This events are located in the “Applications and Services Logs -> Microsoft -> Windows -> TerminalServices-LocalSessionManager -> Operational”. As you can see, here you can find the ID of a user RDP session — Session ID.
Find the corresponding Even Log, right click, select "Attach Task to this event"
Launch “Event Viewer” and find the event you created in Step 1. It should be located toward the top of the “Windows Logs\Application” Log. Once found, right‐click on the event and select “Attach Task to This Event…” then use the defaults for the first couple screens of the wizard.
Create Powershell scripts C:\scirpts\send_sms.ps1 :
$SMTP_USERNAME = "[email protected]"
@D4R4
D4R4 / sharepoint_online_crosssite_copy
Created September 18, 2020 19:11
Allow cross-site site pages copy between Sharepoint Online sites
Install-Module -Name Microsoft.Online.SharePoint.PowerShell
Set-SPOSite -Identity https://COMPANYNAME.sharepoint.com -DenyAddAndCustomizePages $false
Connect-SPOService -Url https://COMPANYNAME-admin.sharepoint.com
Set-SPOSite -Identity https://COMPANYNAME.sharepoint.com -DenyAddAndCustomizePages $false
Set-SPOSite -Identity https://COMPANYNAME.sharepoint.com/sites/SITENAME -DenyAddAndCustomizePages $false
domain: 333.222.111.in-addr.arpa
nserver: ns1.mydns.net
nserver: ns2.mydns.net
admin-c: PA9999-RIPE
tech-c: PA9999-RIPE
zone-c: PA9999-RIPE
mnt-by: ir-ttestt-1-mnt
source: RIPE