Skip to content

Instantly share code, notes, and snippets.

View drola's full-sized avatar

Matjaž Drolc drola

View GitHub Profile
@drola
drola / gist:13ea1ae4397fce7e40f7
Created March 7, 2015 17:26
Identify apache user
APACHE_USER=$(ps axho user,comm|grep -E "httpd|apache"|uniq|grep -v "root"|awk 'END {if ($1) print $1}')
#!/bin/bash
#Repositiories
sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo add-apt-repository ppa:webupd8team/java
#sudo add-apt-repository ppa:chris-lea/node.js
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
wget -O - http://deb.opera.com/archive.key | sudo apt-key add -
sudo sh -c 'echo "deb http://deb.opera.com/opera/ stable non-free" >> /etc/apt/sources.list.d/opera.list'
@drola
drola / err.md
Last active April 29, 2016 08:48

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at OfficeOpenXml.Drawing.ExcelDrawing.GetPixelHeight () <0x41fcfc10 + 0x0009b> in :0 at OfficeOpenXml.Drawing.ExcelDrawing.GetPositionSize () <0x41fcd540 + 0x00037> in :0 at OfficeOpenXml.Drawing.ExcelDrawing+ExcelPosition.set_Row (Int32 value) <0x41fcd3f0 + 0x00046> in :0 at OfficeOpenXml.Drawing.ExcelDrawing..ctor (OfficeOpenXml.Drawing.ExcelDrawings drawings, System.Xml.XmlNode node, System.String nameXPath) <0x41fccbe0 + 0x002a3> in :0 at OfficeOpenXml.Drawing.Chart.ExcelChart..ctor (OfficeOpenXml.Drawing.ExcelDrawings drawings, System.Xml.XmlNode node, System.Uri uriChart, OfficeOpenXml.Packaging.ZipPackagePart part, System.Xml.XmlDocument chartXml, System.Xml.XmlNode chartNode) <0x41fcc950 + 0x0011f> in :0 at OfficeOpenXml.Drawing.Chart.ExcelScatterChart..ctor (OfficeOpenXml.Drawing.ExcelDrawing

CI

Continuously merging developer branches into a common one.

Continuous delivery

Any code commit may be released to customers at any moment. Works well with Scrum project managements. At the end of sprint code goes into production.

#!/bin/bash
# Install git cmake build-essential python2.7 nodejs default-jre
sudo apt-get install git cmake build-essential python2.7 nodejs default-jre
wget https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz
tar -zxvf emsdk-portable.tar.gz
cd ./emsdk-portable
./emsdk update
./emsdk install sdk-incoming-64bit #If you are getting "collect2: error: ld returned 1 exit status" error, try running ./emsdk install -j1 sdk-incoming-64bit
./emsdk activate sdk-incoming-64bit
@drola
drola / upgrade_docker_on_zesty.sh
Last active May 23, 2017 10:30
Upgrades docker.io package with docker-ce package from Docker repository
#!/bin/bash
sudo apt-get remove --yes docker.io
sudo /bin/bash -c 'echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu zesty edge" > /etc/apt/sources.list.d/docker.list'
sudo apt update
sudo apt install --yes docker-ce
@drola
drola / How_to_Angular2_WebGL.md
Last active September 23, 2017 20:27
How_to_Angular2_WebGL.md

How to use Angular with WebGL

If you haven't already, install Angular CLI:

npm install -g @angular/cli

Use Angular CLI to create a minimal Angular app:

@drola
drola / set_nemo_filemanager.sh
Created December 9, 2017 06:14
Set Nemo as the default file manager in Ubuntu 17.10
#!/bin/bash
sudo apt-get install --yes nemo
xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search
gsettings set org.gnome.desktop.background show-desktop-icons false
gsettings set org.nemo.desktop show-desktop-icons true

LED modes on G203 mouse:

Color Cycle

ReportID|Device Index|Sub ID|Address|String                                                    |
      11|          ff|    0e|     3e|       0002|0000000000|       03e8|        64|000000000000|
        |            |      |       |Effect Type|     Zeros|Rate(speed)|Brightness|Zeros       |
@drola
drola / i3 printer.md
Last active August 7, 2019 15:09
i3 printer.md

#Gcodes for my i3 style printer

#Homing, step 1 M852 S-0.0118108; G28; G0 Z8; G0 X110 Y110

#Homing, after manual touch of the bed G92 Z0; G0 Z5; G0 X0