Skip to content

Instantly share code, notes, and snippets.

@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 / uninstall_ajenti.sh
Last active October 31, 2024 09:45
Uninstall Ajenti
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
DISTRO=
OS=
if grep 'Debian' /etc/issue > /dev/null 2>&1 ; then
@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?
@brahimmachkouri
brahimmachkouri / aes-cfb-example.go
Created December 24, 2016 12:46 — forked from temoto/aes-cfb-example.go
Example of AES (Rijndael) CFB encryption in Go. IMHO, http://golang.org/pkg/crypto/cipher/ could benefit a lot from similar snippet.
package main
import (
"crypto/aes"
"crypto/cipher"
"fmt"
)
func EncryptAESCFB(dst, src, key, iv []byte) error {
aesBlockEncrypter, err := aes.NewCipher([]byte(key))

Guide

Note The extension Imagick is now included in Ondrej's PPA. All you need to do now is $ sudo apt-get install php-imagick, and you're done. I'll keep the guide here because a lot of it is still true for other extensions

======

I've installed PHP7 via Ondrej's PPA. He maintains these PPA's on his free time, consider donating

Install dependencies

@brahimmachkouri
brahimmachkouri / nano_apache_syntax_hilighting
Created June 12, 2016 14:27
Gives nano syntax highlighting for Apache configuration files
# Apache files
syntax "apacheconf" "httpd\.conf|mime\.types|\.conf$"
color yellow ".+"
color brightcyan "(AcceptMutex|AcceptPathInfo|AccessFileName|Action|AddAlt|AddAltByEncoding|AddAltByType|AddCharset|AddDefaultCharset|AddDescription|AddEncoding)"
color brightcyan "(AddHandler|AddIcon|AddIconByEncoding|AddIconByType|AddInputFilter|AddLanguage|AddModuleInfo|AddOutputFilter|AddOutputFilterByType|AddType|Alias|AliasMatch)"
color brightcyan "(Allow|AllowCONNECT|AllowEncodedSlashes|AllowOverride|Anonymous|Anonymous_Authoritative|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID)"
color brightcyan "(Anonymous_VerifyEmail|AssignUserID|AuthAuthoritative|AuthDBMAuthoritative|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile|AuthDigestAlgorithm)"
color brightcyan "(AuthDigestDomain|AuthDigestFile|AuthDigestGroupFile|AuthDigestNcCheck|AuthDigestNonceFormat|AuthDigestNonceLifetime|AuthDigestQop|AuthDigestShmemSize)"
color brightcyan "(AuthGroupFile|AuthLDAPAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLD
@brahimmachkouri
brahimmachkouri / .bashrc
Last active October 29, 2024 08:32
To Download : wget bit.ly/my-bashrc
umask 077
EDITOR=nano
export EDITOR
HISTFILESIZE=-1
export HISTFILESIZE
alias ll='ls -laFhGH'
alias h='history'
alias cd..='cd ..'