Skip to content

Instantly share code, notes, and snippets.

View ogavrisevs's full-sized avatar

Oskars Gavriševs ogavrisevs

View GitHub Profile
@ogavrisevs
ogavrisevs / README.md
Created October 13, 2016 13:01
Networking in container

s

@ogavrisevs
ogavrisevs / .bashrc
Last active October 17, 2022 09:03
.tmux.conf
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
@ogavrisevs
ogavrisevs / bash.sh
Created April 13, 2017 10:34
Create timelaps from images
x=1; for i in *jpg; do counter=$(printf %04d $x); ln -s "~/timelapse/$i" /tmp/timelaps/img"$counter".jpg; x=$(($x+1)); done
/tmp/timelaps$ ffmpeg -f image2 -i img%04d.jpg a2.mpg
@ogavrisevs
ogavrisevs / crontab
Last active October 8, 2017 17:50
Send temprature from AM2302 to AWS cloudWatch
* * * * * python /root/main.py
@ogavrisevs
ogavrisevs / run.sh
Created July 19, 2018 17:05
DEploy monga
Setup mongadb instance
-----------------------
localhost$ mongo admin --username root --password hSFRP0Vf856R
cat ./bitnami_credentials
-> add 27017 port to SG
-> add monga user
db = db.getSiblingDB('reaction')
db.createUser( { user: "reactionUser", pwd: "reactionPwd", roles: [ "readWrite", "dbAdmin" ]} )
@ogavrisevs
ogavrisevs / request.xml
Last active August 28, 2018 11:54
Šis iet laukā visiem kas tāpat kā es, pēc stundu ilgas "mudīšanās" devās netā meklēt kaut vienu paraugu kā izsaukt VZD api no bash, veiksmi, spēku, izturību !!!
<!-- from LZD LRG IP007 01 17 Partneriem.docx -->
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:n1="http://ivis.eps.gov.lv/ISS/IVISService/v1-0" xmlns:n2="http://ivis.eps.gov.lv/XMLSchemas/100007/CadastreRegistry/v1-0" xmlns:n3="http://ivis.eps.gov.lv/XMLSchemas/100007/AddressRegistry/v1-0" xmlns:n4="http://ivis.eps.gov.lv/XMLSchemas/100002/EPCommonSchemas/v1-0">
<env:Body>
<n1:InformationBlockRequest>
<n2:CadastreInformationBlockRequest>
<n2:Username>user</n2:Username>
<n2:Password>pass</n2:Password>
<!-- Fiziskās personas kods vai juridiskās personas reģistrācijas numurs -->
<!-- <n2:Code> </n2:Code> -->
<!-- Nekustamā īpašuma kadastra numurs -->
@ogavrisevs
ogavrisevs / Main2.java
Created October 5, 2018 07:10
Convert "EPSG:3059" (LKS-92 TM) to "EPSG:4326" (lat/lng)
package com.bla.laa;
import org.geotools.geometry.jts.JTS;
import org.geotools.referencing.CRS;
import org.geotools.referencing.GeodeticCalculator;
import org.locationtech.jts.geom.Coordinate;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.NoSuchAuthorityCodeException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.operation.MathTransform;
set IP="165.xxx.yyy.227"
$server docker run --rm -it -p 8080:8080 mitmproxy/mitmproxy mitmproxy --listen-host 0.0.0.0 --set block_global=false
$local http_proxy=http://$IP:8080/ curl http://example.com/
$local https_proxy=http://$IP:8080/ curl -k https://example.com/
Install pathogen
-----------------
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
Install nerdtree
-----------------
git clone https://github.com/scrooloose/nerdtree.git ~/.vim/bundle/nerdtree
@ogavrisevs
ogavrisevs / README.md
Last active February 19, 2019 14:26
k8s redis-ha with TCP ingress

Install

helm install --name redis \
  --set replicas=2 \
  --set auth=true \
  --set redisPassword=pass \
  --set persistentVolume.enabled=false \
  stable/redis-ha