Skip to content

Instantly share code, notes, and snippets.

View sadok-f's full-sized avatar
💻
flyimging...

Sadok Ferjani sadok-f

💻
flyimging...
View GitHub Profile
@sadok-f
sadok-f / CloudFlare-DNS-Updater.sh
Created January 23, 2026 11:19
CloudFlare-DNS-Updater
#!/bin/bash
set -e
cd /dynDns-updater/
array[0]="ipinfo.io/ip"
array[1]="-s4 icanhazip.com"
array[2]="-s4 ifconfig.co"
array[3]="-s4 checkip.amazonaws.com"
@sadok-f
sadok-f / gitlab-disable-merge-requests.txt
Last active January 11, 2019 18:43
Gitlab: Disable Merge requests feature
# Edit etc/gitlab/gitlab.rb
gitlab_rails['gitlab_default_projects_features_merge_requests'] = false
# Restart gitlab:
gitlab-ctl reconfigure
gitlab-ctl restart
# Update current projects' settings:
gitlab-rails console production
-->
@sadok-f
sadok-f / gitlab-disable-groups-creation.txt
Last active January 11, 2019 18:42
Gitlab: Disable groups creation
# Edit etc/gitlab/gitlab.rb
gitlab_rails['gitlab_default_can_create_group'] = false
# Restart gitlab:
gitlab-ctl reconfigure
gitlab-ctl restart
# Update current users' settings:
gitlab-rails console production
-->
@sadok-f
sadok-f / Vagrantfile
Created November 19, 2018 20:52
vagrant-vm-for-ansible
Vagrant.require_version ">= 1.9.0"
unless Vagrant.has_plugin?("vagrant-hostmanager")
raise 'Please install the plugin: vagrant-hostmanager!'
end
Vagrant.configure("2") do |config|
config.hostmanager.enabled = true
config.hostmanager.manage_host = true
config.hostmanager.manage_guest = true
@sadok-f
sadok-f / openssl_encrypt_decrypt.php
Created July 20, 2017 13:12 — forked from joashp/openssl_encrypt_decrypt.php
Simple PHP encrypt and decrypt using OpenSSL
<?php
/**
* simple method to encrypt or decrypt a plain text string
* initialization vector(IV) has to be the same when encrypting and decrypting
*
* @param string $action: can be 'encrypt' or 'decrypt'
* @param string $string: string to encrypt or decrypt
*
* @return string
*/
@sadok-f
sadok-f / vagrant-win-howto.md
Created June 22, 2017 16:18 — forked from cmbaughman/vagrant-win-howto.md
Vagrant >=1.6 Windows Instructions

How to set up a Windows VM with Vagrant

Create your VM

==================

  1. Obtain a windows vm from Modern IE.
  • Win 8 OSX
curl -O -L "https://www.modern.ie/vmdownload?platform=mac&virtPlatform=virtualbox&browserOS=IE10-Win8.1&parts=5&filename=VMBuild_20131127/VirtualBox/IE10_Win8/Mac/IE10.Win8.For.MacVirtualBox.part{1.sfx,2.rar,3.rar,4.rar,5.rar}"
@sadok-f
sadok-f / load_kibana_objects.py
Created May 29, 2017 10:39 — forked from turtlemonvh/load_kibana_objects.py
Load kibana objects from json file via command line
#!/bin/env python
help = """
Load kibana dashboards or visualizations exported as json via the kibana ui on the command line.
Example:
$ python load_kibana_dashboards.py export.json 'http://un:pw@localhost:9207'
Posting: Per-node-doc-count (visualization)
{"_index":".kibana","_type":"visualization","_id":"Per-node-doc-count","_version":2,"_shards":{"total":1,"successful":1,"failed":0},"created":false}
server {
listen 80;
root /app;
index index.php;
try_files $uri $uri/ /index.php?$args;
location ~\.php$ {
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
import com.amazonaws.AmazonClientException
import com.amazonaws.AmazonServiceException
import com.amazonaws.auth.AWSCredentials
import com.amazonaws.auth.profile.ProfileCredentialsProvider
import com.amazonaws.regions.Region
import com.amazonaws.regions.Regions
import com.amazonaws.services.sqs.AmazonSQS
import com.amazonaws.services.sqs.AmazonSQSClient
import com.amazonaws.services.sqs.model.CreateQueueRequest
import com.amazonaws.services.sqs.model.DeleteMessageRequest
FROM ubuntu:16.04
RUN PACKAGES="\
php-cli \
php-mysql \
php-intl \
php-xml \
php-curl \
php-dom \
" && \