Skip to content

Instantly share code, notes, and snippets.

View kikislater's full-sized avatar
🏄‍♂️

Sylvain POULAIN kikislater

🏄‍♂️
View GitHub Profile
@kikislater
kikislater / Export_layout_from_pyqgis3_script.py
Created April 15, 2019 15:22
Export QGIS 3 layout from pyqgis 3 script
#!/usr/bin/env python3
import os
from qgis.core import (QgsProject, QgsLayoutExporter, QgsApplication)
QgsApplication.setPrefixPath("/usr", True)
gui_flag = False
app = QgsApplication([], gui_flag)
app.initQgis()
@kikislater
kikislater / SITL_Vagrant_Arduplane.sh
Created July 17, 2019 16:26
SITL Vagrant Arduplane
git clone https://github.com/ArduPilot/ardupilot.git
cd ardupilot
vagrant up
vagrant ssh
cd /vagrant
git submodule update --init --recursive
#Edit ~/ardupilot/Tools/autotest/location.txt to add new location
sim_vehicle.py -j2 -v ArduPlane --location new_location
@kikislater
kikislater / comment.sh
Last active January 22, 2020 06:47 — forked from haisum/script.sh
comment and uncomment lines in bash script via sed
sed -i '/<pattern>/s/^/#/g' file #comment
sed -i.bak '/argtypes/s/^/#/' file #comment and backup
sed -i '/<pattern>/s/^#//g' file #uncomment
@kikislater
kikislater / mprime-phc-setup.sh
Created March 9, 2020 07:35
Script to auto find undervolt CPU with PHC method : https://wiki.archlinux.org/index.php/PHC
#!/bin/bash
# Find lowest vids for PHC so that mprime doesn't find errors.
# Shouldn't crash the computer, but might.
#####################################
# Parameters.
# short_test_length should be between 15 and 60 s.
# Use a longer length to avoid crashing during the test.
# ------------------------------------------------------------------------------
# tlp - Parameters for power saving
# See full explanation: https://linrunner.de/en/tlp/docs/tlp-configuration.html
# Notes:
# - Some parameters are disabled, remove the leading '#' to enable # them;
# shown values are suggestions not defaults
# - Default *: intrinsic default that is effective when the parameter is missing
# or disabled by a leading '#'; use PARAM="" to disable intrinsic defaults for
# parameters with text string values
#
# ~/.bashrc
#
[[ $- != *i* ]] && return
colors() {
local fgc bgc vals seq0
printf "Color escapes are %s\n" '\e[${value};...;${value}m'
@kikislater
kikislater / powertop.service
Created July 25, 2020 14:21
powertop.service
[Unit]
Description=Powertop tunings
[Service]
Type=oneshot
ExecStart=/usr/bin/powertop --auto-tune
[Install]
WantedBy=multi-user.target
@kikislater
kikislater / userContent.css
Created August 11, 2020 18:50
userContent.css
* {
-moz-animation: none !important;
animation: none !important;
}
@kikislater
kikislater / Manjaro gpg key errors
Last active January 21, 2024 10:09
Manjaro gpg error
sudo rm -R /etc/pacman.d/gnupg/
sudo rm -R /root/.gnupg/ # only if the directory exists
sudo gpg --refresh-keys
sudo pacman-key --init
sudo pacman-key --populate
# add keyserver to gpg.conf
echo 'keyserver hkp://keys.openpgp.org' | sudo tee -a /etc/pacman.d/gnupg/gpg.conf
sudo pacman-key --refresh-keys
sudo pacman -S archlinux-keyring manjaro-keyring
sudo rm /var/cache/pacman/pkg/*.sig
@kikislater
kikislater / Git force pull to overwrite local files
Created September 26, 2020 05:35
Git clean and force pull to overwrite local files
# Git clean and force pull to overwrite local files
git reset --hard HEAD
git clean -f -d ## -n to get it interactive
git pull