Skip to content

Instantly share code, notes, and snippets.

View c4software's full-sized avatar
🎯
Focusing

Brosseau Valentin c4software

🎯
Focusing
View GitHub Profile
@c4software
c4software / sample.sh
Created February 17, 2024 20:36
wget speed test
# 500 Mo
wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip
# 10Go
wget -O /dev/null http://test-debit.free.fr/10485760.rnd
@c4software
c4software / Dockerfile
Created March 30, 2023 15:13 — forked from jcavat/Dockerfile
docker-compose with php/mysql/phpmyadmin/apache
FROM php:7.1.2-apache
RUN docker-php-ext-install mysqli
@c4software
c4software / temperature_ressentie.yaml
Created November 1, 2022 10:54
Home Assistant - Calcul de la température ressentie
- platform: template
sensors:
salon_temperature_ressentie:
friendly_name: 'Ressenti T° Salon'
value_template: >-
{% set T = ((states.sensor.netatmo_maison_salon_temperature.state|float)*1.8)+32 %}
{% set RH = states.sensor.netatmo_maison_salon_humidity.state|float %}
{% set STEADMAN_HI = 0.5 * (T + 61.0 + ((T-68.0)*1.2) + (RH*0.094)) %}
{% if STEADMAN_HI >= 80 %}

Proxmox GPU Passthrough

Config :

  • Motherboard : Asrock x300
  • CPU : AMD Ryzen 5 PRO 4650G with Radeon Graphics
  • GPU : AMD Ryzen 5 PRO 4650G with Radeon Graphics
  • Ram : DDR4 2133 MHz

Setting it all up

Update packages

@c4software
c4software / README.md
Last active May 14, 2022 20:06
[Archlinux] XRDP & Gnome Keyring Unlock (May 2022 temporary fix)

Hi 👋,

I have a full headless VM for remote machine, since few weeks Google Chrome became really slow to start (2min, I smell a timeout)… All the problems are related to Gnome-Keyring which seems not to unlock.

Step 1 /etc/pam.d/system-auth

Comment every lines with pam_systemd_home.so in the /etc/pam.d/system-auth to disable it.

Step 2 /etc/pam.d/xrdp-sesman

Original: https://forum.duolingo.com/comment/9139466
Duolingo announced that it will be shutting down its forums on 2022-03-22. There is a chance it may keep them in read-only mode, but no guarantee. Therefore this is a copy of the incredibly useful Esperanto Megapost from Duolingo Esperantist amuzulo.
@c4software
c4software / file-download.js
Created September 8, 2020 07:13
Produce & Download a JSON object directly from the browser
const saveAsJsonLocally = (obj, filename) => {
const data = JSON.stringify(obj, null, 2);
const blob = new Blob([data], {type: 'text/plain'});
const e = document.createEvent('MouseEvents');
const a = document.createElement('a');
a.download = filename;
a.href = window.URL.createObjectURL(blob);
a.dataset.downloadurl = ['text/json', a.download, a.href].join(':');
@c4software
c4software / rmad.sh
Created March 6, 2020 14:11 — forked from nobodyzxc/ad_remove_main.sh
remove ads in apk
APK="$1"
if [ -f $APK ];then
./apktool d "$APK"
grep -lR "\->loadAd" "${APK%.*}" | xargs sed -i '/\->loadAd/d'
./apktool b "${APK%.*}" -o "${APK%.*}_no_ad.apk"
java -jar sign.jar --overwrite --apks "${APK%.*}_no_ad.apk"
rm -rf "${APK%.*}"
else
echo "please input apk file"
fi
@c4software
c4software / sample.java
Created July 31, 2018 12:02
Test if user have enabled the Android Location Service.
private boolean locationServiceEnabled() {
final LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
if (locationManager != null) {
try {
return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) ||
locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
} catch (final Exception e) {
Timber.e(e);
return false;
@c4software
c4software / download-multiple-files.js
Created June 6, 2018 08:56 — forked from noelvo/download-multiple-files.js
Download multiple files then compress to one zip file using JSZip & JSZip-utils
var zip = new JSZip();
var count = 0;
var zipFilename = "zipFilename.zip";
var urls = [
'http://image-url-1',
'http://image-url-2',
'http://image-url-3'
];
urls.forEach(function(url){