Skip to content

Instantly share code, notes, and snippets.

View JorgeFrancoIbanez's full-sized avatar

Jorge Franco Ibañez JorgeFrancoIbanez

  • Ubisoft
  • Montreal
View GitHub Profile
@JorgeFrancoIbanez
JorgeFrancoIbanez / fedora_install_python3.md
Created December 7, 2022 15:39 — forked from zobayer1/fedora_install_python3.md
Install Python 3.6, 3.7, 3.8 in your Fedora system

Python 3.9 comes as a default with Fedora 34. However, sometimes you may wish to install older versions for development and test purposes. Apart from groupinstall command, these instructions work for CentOS and REHL systems as well.

Prerequisites

Install python development dependencies.

sudo dnf groupinstall "Development Tools"
sudo dnf install python3-devel openssl-devel zlib-devel bzip2-devel sqlite-devel libffi-devel

Note: You will need to rebuild and reinstall if you install new source or development libraries for python. Do not create or modify symlinks for python, python3, etc, as that may and will break many dependent libraries in your system.

@JorgeFrancoIbanez
JorgeFrancoIbanez / lsiommu
Created December 8, 2020 18:25 — forked from flungo/lsiommu
List the devices and their IOMMU groups.
#!/bin/bash
for d in $(find /sys/kernel/iommu_groups/ -type l | sort -n -k5 -t/); do
n=${d#*/iommu_groups/*}; n=${n%%/*}
printf 'IOMMU Group %s ' "$n"
lspci -nns "${d##*/}"
done;
@JorgeFrancoIbanez
JorgeFrancoIbanez / vim_add_theme.sh
Last active October 15, 2020 14:04
Set up vim themes on bash (Debian/Ubuntu) Usage: chmod +x /path/vim_add_theme.sh | /path/vim_add_theme.sh <name_of theme> <url_raw_color_file>
#!/bin/bash
############## README #######################
# This script will clean your ~/.vimrc #
# If you want to use it ahve that in mind. #
#############################################
### Vim themes ###
## https://www.slant.co/topics/480/~best-vim-color-schemes
##################
How to disable cloud-init in Ubuntu
Prevent start
Create an empty file to prevent the service from starting
sudo touch /etc/cloud/cloud-init.disabled
Uninstall
Disable all services (uncheck everything except "None"):
dpkg-reconfigure cloud-init
Uninstall the package and delete the folders
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Services\MapsBroker' -Name Start -Value 4
$onesync = (Get-ChildItem 'HKLM:\System\CurrentControlSet\Services' | ?{$_.PSChildName -like "OneSync*"}).Name
$here = Get-Location
cd HKLM:\
ForEach($sync in $onesync) {
Set-ItemProperty -Path $sync -Name Start -Value 4
}
cd $here
Get-Service OneSync* | Stop-Service -Force
Get-Service MapsBroker | Stop-Service -Force
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="oobeSystem">
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<!-- logon this user automatically
which runs first logon commands -->
<UserAccounts>
<AdministratorPassword>
<Value>ormuco</Value>
#!/bin/bash
for i in $(grep "^[^#;]" /etc/ssh/sshd_config); do
echo $i
for s in ChallengeResponseAuthentication PasswordAuthentication PermitRootLogin X11Forwarding GSSAPIAuthentication;do
echo $s
if [[ $i == "$s"* ]]; then
echo $i;
echo $s;
sed -i "s/$s .*/$s no/g" /etc/ssh/sshd_config;
fi;
@JorgeFrancoIbanez
JorgeFrancoIbanez / ubuntu14.04
Last active August 6, 2019 16:34
SSH KEY cOnfuiguration for only ssh access
#!/bin/bash
for i in $(grep "^[^#;]" /etc/ssh/sshd_config); do
echo $i
for s in ChallengeResponseAuthentication PasswordAuthentication PermitRootLogin X11Forwarding;do
echo $s
if [[ $i == "$s"* ]]; then
echo $i;
echo $s;
sed -i "s/$s .*/$s no/g" /etc/ssh/sshd_config;
fi;
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDatabase\pci#ven_1af4&dev_1001&subsys_00000000]
"Service"="viostor"
"ClassGUID"="{4D36E97B-E325-11CE-BFC1-08002BE10318}"
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDatabase\pci#ven_1af4&dev_1001&subsys_00020000]
"Service"="viostor"
"ClassGUID"="{4D36E97B-E325-11CE-BFC1-08002BE10318}"
@JorgeFrancoIbanez
JorgeFrancoIbanez / print-trove-datastore-version-flavors.py
Created June 13, 2019 18:51
Openstack retrieve datastore version of a single datastore and print it
from keystoneauth1.identity import v3
from keystoneauth1 import session
from troveclient.v1 import client as Trove
resources = {}
class Auth:
def __init__(self):
username = "username"
password = "password"