exec - Returns last line of commands output
passthru - Passes commands output directly to the browser
system - Passes commands output directly to the browser and returns last line
shell_exec - Returns commands output
\`\` (backticks) - Same as shell_exec()
popen - Opens read or write pipe to process of a command
proc_open - Similar to popen() but greater degree of control
pcntl_exec - Executes a program
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
# Extract Deployment information from MECM (SCCM) through WMI for a specific device. | |
# Useful to monitor specific devide deployment current progression state or to get some history informations | |
$ComputerName = "VM-XXX" # computer to find deployment information | |
$ExecutionTime = '20240327100900.000000+000' # date of the oldest log to extract | |
$SiteCode = "XYZ" | |
pushd "$($SiteCode):" | |
$steps = Get-WmiObject -ComputerName "srv-mecm-01" -Namespace "Root\SMS\site_$SiteCode" -Query "Select * from SMS_TaskSequenceExecutionStatus Where ResourceID='$(get-cmdevice -name $Computername -Fast | select -ExpandProperty ResourceId)' AND ExecutionTime > '$ExecutionTime'" ` |
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
# Testé avec Powershell 5.1 | |
# Documentation disponible : # https://learn.microsoft.com/en-us/powershell/scripting/learn/remoting/jea/overview?view=powershell-7.3 | |
# Réalise les opérations suivantes | |
# - crée sur une machine membre d'un domaine AD un endpoint JEA, une session avec un role affecté à celle-ci | |
# - autorise un utilisateur du domaine à accéder à ce rôle (au travers de cette session) | |
# - l'autorisation se fait via la création d'un groupe local auquel on pourra ajouter d'autres membres | |
# - les cmdlets autorisés sont ceux par défaut, il faudra étider le fichier de configuration (voir commentaires plus bas) | |
######## Elements à paramétrer | |
$AllowedUsername = "<DOMAIN>\<Utilisateur>" |
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
# This example script will output information about the video driver on remote computers | |
# It allows to quickly compare 2 or more computer against their driver version to potentialy | |
# identify driver differences between a buggy computer and a working one | |
$computers = @("computer1","computer2") | |
Get-WmiObject -query "Select Caption,DriverVersion,DriverDate,InfSection,InstalledDisplayDrivers,SystemName From Win32_VideoController" ` | |
-ComputerName $computers ` | |
| Select SystemName,Caption,DriverVersion,DriverDate,InfSection,InstalledDisplayDrivers ` | |
| Out-GridView |
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
################################################################################################################## | |
# Description: | |
# This script helps Extensions creators to quickly create a new extension that can add some contextual menu | |
# to their desired location (Collection, Software Update group, whatever the Administrator UI Allows...) | |
# When creating an extension in SCCM, you need to define with which component of the UI it will interact. | |
# this guid is a bit difficult to find (you need to search through XML files). | |
# For this purpose, this script will create an extension action per UI component so that everywhere you | |
# can right click in the SCCM Administrator User Interface, a contextual menu will appear with it's GUID displayed | |
# clicking on this GUID will copy it to the clibpard. | |
################################################################################################################## |
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
{some:"text"} |
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
// TLDR: I am trying to convert (new Buffer([86,97,108,130,114,105,101])).toString('utf8') to "Valérie" (and not "Val�rie"" | |
/* | |
I am using a node module which permit me to interact with a powershell console. | |
During the execution of a command, i encounter encoding problems | |
Here is an example of what i receive from the module | |
*/ | |
var iconv = require('iconv-lite'); | |
// The below variable is the kind of data that the module process. This data is received from the child process's stdout |
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
const net = require('net'); | |
// common proxy ports | |
var honeyPort = [ 8080, 3128, 3129, 80 ]; | |
function FakeSrv(port){ | |
this.port = port; | |
this.server = net.createServer((socket) => { | |
socket.end('Bye\n'); |
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
const StringDecoder = require('string_decoder').StringDecoder; | |
const decoder = new StringDecoder('utf8'); | |
var x = [49, // opcode | |
10,0,0,0, // cnt | |
0,0,0,0, // Highlight 1 | |
77,69, 32,70, 85,67, 75,32, 73,83, 76,65, 77,0, // NAME 1 (length=14) | |
0,0,0,0, // HL 2 | |
0, // NAME 2 (length=0) |
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
rebrec@rebrec-cin:/tmp/build9052822487515109858.tmp$ cat Blink.cpp.hex | |
:100000000C945C000C9479000C9479000C947900A9 | |
:100010000C9479000C9479000C9479000C9479007C | |
:100020000C9479000C9479000C9479000C9479006C | |
:100030000C9479000C9479000C9479000C9479005C | |
:100040000C949A000C9479000C9479000C9479002B | |
:100050000C9479000C9479000C9479000C9479003C | |
:100060000C9479000C947900000000070002010054 | |
:100070000003040600000000000000000102040864 | |
:100080001020408001020408102001020408102002 |
NewerOlder