Outils pour utilisateurs

Outils du site


blog

Utiliser Git pour vos logos en SVG

Voir http://w.xuv.be/projects/design_with_git

Faire du diffing graphique (oui ! pas en texte) avec Git sur des images vectorielle en SVG

compare.py

#!/usr/bin/env python
import sys, os
 
inkscape = "inkscape"
 
local = sys.argv[1]
remote = sys.argv[2]
tempdir = "/home/markv/gittemp/"
localpng = tempdir+"local.png"
remotepng = tempdir+"remote.png"
 
if(not (remote.endswith(".svg") and (local != "/dev/null"))):
    os.system("xxdiff %s %s" % (local, remote))
else:
    os.system(inkscape+" "+local+" --export-png="+localpng+" -w600 -h900 -C -bffffff -y1.0")
    os.system(inkscape+" "+remote+" --export-png="+remotepng+" -w600 -h900 -C -bffffff -y1.0")
    os.system("compare "+localpng+" "+remotepng+" - | display")
    os.remove(localpng)
    os.remove(remotepng)

Ajoutez dans votre .gitconfig (adapter le chemin)

~/.gitconfig

[difftool "compare"]
        cmd = "/home/USER/bin/compare.py $LOCAL $REMOTE - | display"

Puis par exemple

git difftool -y -t compare
2025/03/24 15:06

Utiliser virtualenv dans un notebook iPython

Source : https://help.pythonanywhere.com/pages/IPythonNotebookVirtualenvs/

Install the ipython kernel module into your virtualenv

python3 -m venv plop
cd plop
source bin/activate
pip install --upgrade pip
pip install ipykernel
#deactivate

Now run the kernel “self-install” script

python -m ipykernel install --user --name=plop

Replacing the --name parameter as appropriate.

You should now be able to see your kernel in the IPython notebook menu: Kernel -> Change kernel and be able so switch to it (you may need to refresh the page before it appears in the list). IPython will remember which kernel to use for that notebook from then on.

2025/03/24 15:06

Utilisateur plusieurs noms même uid

#chown -h -R --from=Plop:Plop reference:reference /
find / /var /home /data /opt -xdev \( -type f -o -type d \) \( -uid $(id -u Plop) -o -gid $(id -g Plop) \) -exec chown $(id -u reference):$(id -g reference) {} \;
usermod -o -u $(id -u reference) -g $(id -g reference) Plop
2025/03/24 15:06

USB over TCP/IP avec USB/IP

Installation

Client et Serveur

Installation de USB/IP sous Debian

apt-get install usbip

Attachement

Serveur
modprobe usbip-core
modprobe usbip-host
usbipd -D
usbip list -l
 
usbip bind -b 1-1

Pour tester

usbip  list -r 127.0.0.1
Client
modprobe usbip-core
modprobe vhci-hcd
usbip -l list -r 192.168.56.10
usbip attach -r 192.168.56.10 -b 1-1

Détach

Sur le Client

usbip port
usbip detach -p 00

Sur le Serveur pour stopper le partage

usbip unbind -b 1-1
2025/03/24 15:06

Upgrade dist-upgrade Ubuntu

Voir : https://www.digitalocean.com/community/tutorials/how-to-upgrade-ubuntu-12-04-lts-to-ubuntu-14-04-lts

sudo apt-get update
sudo apt-get upgrade
# apt-cache policy update-manager-core
sudo apt-get install update-manager-core
sudo do-release-upgrade
2025/03/24 15:06
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki