Skip to content

Instantly share code, notes, and snippets.

View tudo75's full-sized avatar

Nicola Tudino tudo75

  • self employed IT Consultant
  • Italy
View GitHub Profile
@tudo75
tudo75 / nvidia-smi-queries.md
Last active March 14, 2024 22:17
Useful nvidia-smi queries

Useful nvidia-smi Queries

Updated 11/06/2017 07:32 AM

What are useful nvidia-smi queries for troubleshooting?

VBIOS Version

Query the VBIOS version of each device:

@tudo75
tudo75 / app.py
Created December 30, 2020 20:48 — forked from carlos-jenkins/app.py
Example to set to a Gtk application a custom theme.
# -*- coding:utf-8 -*-
#
# Copyright (C) 2013 Carlos Jenkins <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@tudo75
tudo75 / msys2-visual-studio-code.md
Created December 17, 2020 20:43 — forked from dhkatz/msys2-visual-studio-code.md
Using MSYS2 with Visual Studio Code

Using MSYS2 with Visual Studio Code is extremely easy now thanks to the Shell Launcher extension by Tyriar.

First, install the extension and reload Visual Studio Code.

Then, open the settings.json to edit your settings.

Add the field shellLauncher.shells.windows. I recommend using autocompletion here so that all the default shells are added.

You should having something like this now:

@tudo75
tudo75 / Grid
Created December 16, 2020 00:51 — forked from lithid/Grid
Here is a grid using python and GTK3, loading dynamically based on window size/re-size. I came up with this example while trying to mimic a gridview of images for a wallpaper application. The example is below.
#!/usr/bin/env python2
from gi.repository import Gtk
class Grid(Gtk.Window):
widget_list = []
WIDGET_SIZE = 140
COLS = 1
NUM = 100
def calcule_columns(self, scroll, grid):
@tudo75
tudo75 / QImageViewer.py
Created November 1, 2020 00:07 — forked from acbetter/QImageViewer.py
Image Viewer Example by PyQt5 and Python 3
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QImage, QPixmap, QPalette, QPainter
from PyQt5.QtPrintSupport import QPrintDialog, QPrinter
from PyQt5.QtWidgets import QLabel, QSizePolicy, QScrollArea, QMessageBox, QMainWindow, QMenu, QAction, \
qApp, QFileDialog
@tudo75
tudo75 / vbox-backup.sh
Created February 23, 2020 19:37 — forked from dv336699/vbox-backup.sh
Backup Running VirtualBox VMs
#!/bin/sh
BASEFOLDER=/home/vbox/backups
for VMNAME in $(VBoxManage list runningvms | cut -d ' ' -f1 | sed 's/"//g;')
do
echo ""
VBoxManage controlvm "$VMNAME" acpipowerbutton
echo "Waiting for VM "$VMNAME" to poweroff..."
until $(VBoxManage showvminfo --machinereadable "$VMNAME" | grep -q ^VMState=.poweroff.)
@tudo75
tudo75 / HLS_dvr.sh
Created June 4, 2017 07:06 — forked from John07/HLS_dvr.sh
A small script to make recording http live streams (HLS, those streams that work on iOS devices) nicer on a Mac. Script records the stream for a defined period of time and sends the user notifications if anything goes wrong and once it's done.
# required: ffmpeg (e.g. from homebrew), terminal-notifier from https://github.com/alloy/terminal-notifier
# you can schedule this with launchd to run e.g. weekly
# Specify in seconds how long the script should record (default here is 1 hour).
seconds=3600
# Date format for the recording file name
DATE=`date "+%d-%m-%y_%H-%M"`
# start ffmpeg recording
@tudo75
tudo75 / gist:013da01ad5f2f1584964cbb778d338b0
Created October 23, 2016 03:34 — forked from brew-martin/gist:5281323
Small and simple cookie banner, uses a bit of PHP, JavaScript/jQuery and some CSS for styling the banner.
<?php if(!isset($_COOKIE["comply_cookie"])) { ?>
<div id="cookies">
<p>Our website uses cookies. By continuing we assume your permission to deploy cookies, as detailed in our <a href="yourPolicy">privacy policy</a>.
<span class="cookie-accept" title="Okay, close"><img src="img/close.png" alt="Close"/></span></p>
</div>
<?php } ?>
@tudo75
tudo75 / index.html
Last active August 29, 2015 14:16
setInterval clearInterval Javascript demo
<!DOCTYPE html>
<html>
<body>
<p>Clock start on page load and stop after 5 seconds:</p>
<p id="demo"></p>
<p>Clock start on page load and stop when you click button:</p>
<p id="demo1"></p>
<button onclick="myStartFunction()">Restart second clock</button>
@tudo75
tudo75 / index.html
Created November 22, 2014 03:48
Chart.js Demo // source http://jsbin.com/bikoqe
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Chart.js Demo</title>
<style id="jsbin-css">
img {
border: 1px dashed red;
margin-top: 20px;
}