Skip to content

Instantly share code, notes, and snippets.

View Bigous's full-sized avatar
💭
May the force be with you

Richard Natal Bigous

💭
May the force be with you
View GitHub Profile
@Bigous
Bigous / Measure-Time.ps1
Created October 13, 2022 13:32
PowerShell function to measure time execution of a program
function global:Measure-Time
{
[CmdletBinding()]
param ([string] $Command,
[string] $Arguments = "",
[switch] $Silent = $false
)
$creation = 0
$exit = 0
@Bigous
Bigous / Edit with Sublime.reg
Created July 22, 2022 12:13
Edit with Sublime context menu Windows
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Edit with Sublime]
"Icon"="C:\\\\Program Files\\\\Sublime Text\\\\sublime_text.exe"
[HKEY_CLASSES_ROOT\*\shell\Edit with Sublime\command]
@="C:\\Program Files\\Sublime Text\\sublime_text.exe \"%1\""
@Bigous
Bigous / filter-hd.ps1
Last active January 8, 2022 00:14
PowerShell to filter m3u HD tv only
Select-String .\file.m3u -Context 0,1 -Pattern "^(#EXTINF:.*\bHD$)|(#EXTM3U)|(#EXT-X-SESSION-DATA)" |
foreach {
$_.Line
if($_.Line -match "^#EXTINF:.*\bHD$") { $_.Context.PostContext[0] }
} > .\file_hd.m3u
@Bigous
Bigous / settings.json
Last active August 15, 2020 13:26
Windows Terminal Settings
// This file was initially generated by Windows Terminal 1.0.1811.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
@Bigous
Bigous / profile.ps1
Created June 3, 2020 15:36
Custom Prompt for PowerShell which shows information on GIT repositories and Anaconda environmant if both are available.
#region Global Colors
$e=[char]27
$cReset="$e[0m"
# $e[(x)m -> 30-37,90-97 Terminal preset foreground colors; 38 Terminal custom foreground color; 40-47,100-107 Terminal preset background colors; 48 Terminal custom background color
# $e[38;2;(r);(g);(b)m -> RGB
# $e[38;5;(n)m -> 0-15 EGA colors; 16-231 6-bit table color; 232-255 Gray scale
# $cFgDarkBlack="$e[38;2;0;0;0m"
# $cFgDarkRed="$e[38;2;128;0;0m"
@Bigous
Bigous / doit.sh
Last active October 18, 2019 19:40
Create a SVN server with CentOS 7 and apache authenticating through LDAP (Active Directory)
#!/bin/bash
yum -y update
yum -y install httpd mod_ldap mod_authnz_external mod_ssl openssl
sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/sysconfig/selinux
setenforce 0
systemctl stop firewalld
systemctl disable firewalld
chkconfig httpd on
systemctl start httpd
yum -y install subversion mod_dav_svn
@Bigous
Bigous / vs-bash-console.bat
Last active October 19, 2018 18:58 — forked from timabell/vs-bash-console.bat
batch script for loading git-bash and the vs tools in the same window
@echo off
echo Loading VC...
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" amd64
echo Loading bash, you may now use git and msbuild in the same console \o/.
"C:\Program Files\Git\usr\bin\bash.exe" --login -i
@Bigous
Bigous / docker-guide.md
Created December 2, 2015 11:29
Docker: from zero to multi-container setups

Docker: from zero to multi-container setups

I've hacked some Docker. Here are the resources that were most essential for me.

What is Docker?

Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications. Consisting of Docker Engine, a portable, lightweight runtime and packaging tool, and Docker Hub, a cloud service for sharing applications and automating workflows, Docker enables apps to be quickly assembled from components and eliminates the friction between development, QA, and production environments. As a result, IT can ship faster and run the same app, unchanged, on laptops, data center VMs, and any cloud.

@Bigous
Bigous / setOracleVars.bat
Last active December 2, 2015 11:23
Define oracledb variables for windows.
@echo off
echo Defining oracle variables...
set "OCI_LOCATION=D:\Oracle\instantclient_12_1\x64"
set "OCI_LIB_DIR=%OCI_LOCATION%\sdk\lib\msvc"
set "OCI_INC_DIR=%OCI_LOCATION%\sdk\include"
set "NODE_ORACLEDB_USER=xxx"
set "NODE_ORACLEDB_PASSWORD=yyy"
set "NODE_ORACLEDB_CONNECTIONSTRING=zzz"
set "PATH=%OCI_LOCATION%;%PATH%"
if defined VS140COMNTOOLS goto vs2015
@Bigous
Bigous / centos_cx_Oracle
Created November 12, 2015 19:02 — forked from floer32/centos_cx_Oracle
CentOS 6: Set up Oracle Instant Client and Python package cx_Oracle
#!/bin/bash
# INSTALL ORACLE INSTANT CLIENT #
#################################
# NOTE: Oracle requires at least 1176 MB of swap (or something around there).
# If you are using CentOS in a VMWare VM, there's a good chance that you don't have enough by default.
# If this describes you and you need to add more swap, see the
# "Adding a Swap File to a CentOS System" section, here:
# http://www.techotopia.com/index.php/Adding_and_Managing_CentOS_Swap_Space