Skip to content

Instantly share code, notes, and snippets.

@brahimmachkouri
brahimmachkouri / move_files.sh
Last active March 27, 2021 11:13
move files in subfolder to the current folder
find ./ -type f -name "*.xls" -print0 | xargs -0 -I {} mv {} ./
@brahimmachkouri
brahimmachkouri / install_tools.sh
Created October 27, 2020 17:04 — forked from allenyllee/install_tools.sh
mount vhdx in linux
#!/bin/bash
# install qemu utils
sudo apt install qemu-utils
# install nbd client
sudo apt install nbd-client
screen mode id:i:2
use multimon:i:0
desktopwidth:i:1680
desktopheight:i:1050
session bpp:i:32
winposstr:s:0,1,880,107,1680,707
compression:i:1
keyboardhook:i:2
audiocapturemode:i:0
videoplaybackmode:i:1
@brahimmachkouri
brahimmachkouri / FilesSnapshot.xml
Created January 8, 2020 18:00
setuserfta v1.7.1 - Passed - Package Tests Results
<?xml version="1.0" encoding="utf-8"?>
<fileSnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<files>
<file path="C:\ProgramData\chocolatey\lib\setuserfta\setuserfta.nupkg" checksum="89CC7893D63C1EBB7C197C96F92DB706" />
<file path="C:\ProgramData\chocolatey\lib\setuserfta\setuserfta.nuspec" checksum="89839B7401F25F411F211FDE27A68D46" />
<file path="C:\ProgramData\chocolatey\lib\setuserfta\SetUserFTA.zip.txt" checksum="800F22077EB541F743EBAE8C49647854" />
<file path="C:\ProgramData\chocolatey\lib\setuserfta\tools\chocolateyInstall.ps1" checksum="E47D4E57864F5C479884AD819CDBE6EA" />
<file path="C:\ProgramData\chocolatey\lib\setuserfta\tools\EULA.txt" checksum="E8BB21C92A8C13EFA572DC3B2AC5F538" />
<file path="C:\ProgramData\chocolatey\lib\setuserfta\tools\SetUserFTA\EULA.txt" checksum="E8BB21C92A8C13EFA572DC3B2AC5F538" />
<file path="C:\ProgramData\chocolatey\lib\setuserfta\tools\SetUserFTA\SetUserFTA - the kolbicz blog.url"
@brahimmachkouri
brahimmachkouri / fusion-version.ps1
Created March 18, 2019 16:37
Get the latest version of fusioninventory agent in Powershell
$result = (Invoke-WebRequest –Uri "https://github.com/fusioninventory/fusioninventory-agent/releases/latest" -UseBasicParsing).BaseResponse.ResponseUri.AbsolutePath.Split('/')[-1]
@brahimmachkouri
brahimmachkouri / latest-fusion-agent.php
Last active February 26, 2019 16:35
Get the latest version of fusioninventory agent
<?php
// BM 20190226
function get_links($link)
{
$result = "";
$ret = array();
/*** a new dom object ***/
$dom = new domDocument;
#!/bin/bash
################################
# OS X Install ISO Creater #
# #
# Author: shela #
################################
#######################################
# Declarations
@brahimmachkouri
brahimmachkouri / default
Last active November 30, 2017 17:31
nginx userdir + php-fpm
server {
listen 80;
server_name localhost;
# ... other default site stuff, document root, etc. ...
location ~ ^/~(?<userdir_user>.+?)(?<userdir_uri>/.*)?$ {
alias /home/chroot/home/$userdir_user/public_html$userdir_uri;
index index.html index.htm index.php;
autoindex on;
@brahimmachkouri
brahimmachkouri / vagrant-uuids.sh
Last active June 24, 2017 17:31
This script displays vagrant index_uuid for each VM created with Vagrant (macOS)
#!/bin/bash
vms=$(vagrant global-status | awk -F " " '{ print $5 }' | grep Users)
for vm in $vms
do
if [ -d "$vm" ]; then
cat $vm/.vagrant/machines/default/virtualbox/index_uuid
echo " $vm"
fi
done
@brahimmachkouri
brahimmachkouri / pushbullet.php
Created March 31, 2017 17:52 — forked from ghostbitmeta/pushbullet.php
Synology + Pushbullet
<?php
// Used code from the following sources:
// https://gist.github.com/styxit/e34d4c6f8cb23d55f5af#file-synology-pushover-php
// http://pastebin.com/iHAFAHGq
// Thanks to: https://styxit.com/2014/05/10/synology-pushover.html
// Only allow request made by localhost?