Skip to content

Instantly share code, notes, and snippets.

View arturfog's full-sized avatar

Artur arturfog

  • Wroclaw, Poland
View GitHub Profile
@arturfog
arturfog / windows_to_go.ps1
Last active May 11, 2018 13:14
List of commands to create WinToGo USB drive
$Disk = Get-Disk | Where-Object {$_.Path -match "USBSTOR" -and $_.Size -gt 20Gb -and -not $_.IsBoot }
Clear-Disk –InputObject $Disk[0] -RemoveData
Initialize-Disk –InputObject $Disk[0] -PartitionStyle MBR
$SystemPartition = New-Partition –InputObject $Disk[0] -Size (350MB) -IsActive
Format-Volume -NewFileSystemLabel "UFD-System" -FileSystem FAT32 -Partition $SystemPartition
@arturfog
arturfog / docker-show-repo-tags.sh
Created May 12, 2018 09:05
Allows to show available tags/version of selected docker image
#!/bin/sh
# Source:https://stackoverflow.com/questions/24481564/how-can-i-find-docker-image-with-specific-tag-in-docker-registry-in-docker-comma
#
# Simple script that will display docker repository tags.
#
# Usage:
# $ docker-show-repo-tags.sh ubuntu centos
for Repo in $* ; do
curl -s -S "https://registry.hub.docker.com/v2/repositories/library/$Repo/tags/" | \
sed -e 's/,/,\n/g' -e 's/\[/\[\n/g' | \
@arturfog
arturfog / set_gnome3_mono_font.sh
Created May 29, 2018 15:37
Sometimes font doesn't appear in gnome-terminal font selection panel. This allows to select any installed font as monospace font.
#!/bin/bash
gsettings set org.gnome.desktop.interface monospace-font-name 'Noto Sans Mono 15'
@arturfog
arturfog / conan_notes.sh
Last active June 10, 2018 13:04
Conan.io notes
conan source ..
conan install -o aws-sdk-cpp:build_s3=True -o aws-sdk-cpp:build_transfer=True -o min_size=False -o aws-sdk-cpp:shared=True -s os=Linux -s arch=x86-64 -s build_type=Release .
conan build .
conan package .
conan export-pkg --package-folder=./package . arturfog/release
conan upload aws-sdk-cpp/1.4.64@arturfog/release --all -r my-conan-repo
conan remote add arturfog-conan-repo https://api.bintray.com/conan/arturfog/oss-conan
conan search -r arturfog-conan-repo
@arturfog
arturfog / start_ubuntu_docker.sh
Created June 21, 2018 17:22
Creates docker container with ubuntu that can run GUI apps with sound and 3d acceleration
xhost +local:root
sudo docker run -it \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=unix$DISPLAY \
-v $HOME/Downloads:/tmp/Downloads \
--device /dev/dri \
--device /dev/snd \
-v /dev/shm:/dev/shm \
-v $XDG_RUNTIME_DIR/pulse:$XDG_RUNTIME_DIR/pulse \
-e PULSE_SERVER=unix:$XDG_RUNTIME_DIR/pulse/native \
apt update && apt install -y sudo \
mc \
alsa-utils \
libgl1-mesa-dri \
libgl1-mesa-glx \
hicolor-icon-theme \
ca-certificates \
libcanberra-gtk* \
libpulse0 \
chromium-browser
#!/bin/bash
#sudo systemctl start docker
sudo docker start ubuntu
sudo docker exec -u artur -e DISPLAY="unix:0" -e COLUMNS="`tput cols`" -e LINES="`tput lines`" -ti ubuntu zsh
@arturfog
arturfog / dev_env_arm_on_x86.sh
Created October 4, 2018 18:19
Chroots to ARM environment that can be used for compiling and development
apt-get install qemu-user-static
# Mount my target filesystem on /mnt
mount -o loop fs.img /mnt
# Copy the static ARM binary that provides emulation
# Or, more simply: cp /usr/bin/qemu-arm-static /mnt/usr/bin
cp $(which qemu-arm-static) /mnt/usr/bin
# Finally chroot into /mnt, then run 'qemu-arm-static bash'
ng new client --routing --prefix tcc --skip-install
ng generate module shared --module app
ng generate module shared/material --module shared
ng serve -o
npm i -g @angular/cli
npm install gulp-cli -g
npm install --save-dev typescript gulp gulp-typescript
npm install --save express socket.io @types/express @types/socket.io
@arturfog
arturfog / Anet+A6_settings.inst.cfg
Created December 4, 2018 19:41 — forked from maciekish/Anet+A6_settings.inst.cfg
Anet A6 profile for Cura 3.5. Start Cura once, create a custom printer called "Anet A6" without changing any of the settings and close Cura. Save and overwrite both files in "AppData\Roaming\cura\3.1\definition_changes" and start Cura again.
[general]
version = 4
name = Anet A6_settings
definition = custom
[metadata]
setting_version = 5
type = definition_changes
[values]