Skip to content

Instantly share code, notes, and snippets.

View somat's full-sized avatar
🏠
Working from home

Akhmat Safrudin somat

🏠
Working from home
View GitHub Profile
network:
ethernets:
ens3:
addresses:
- 10.0.0.5/24
routes:
- to: default
via: 10.0.0.1
nameservers:
addresses:
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo usermod -aG docker $USER
echo "Installation finished, logout and relogin, then run docker run hello-world"
docker run -e MYSQL_ROOT_HOST=% -e MYSQL_ROOT_PASSWORD=root -p 3306:3306 -d mysql/mysql-server
docker rmi $(docker images -f "dangling=true" -q)
docker container rm $(docker container ls -aq)
Stop all running containers
docker stop $(docker ps -aq)
Remove all containers
docker rm $(docker ps -aq)
npm install @coreui/coreui @coreui/coreui-plugin-chartjs-custom-tooltips @coreui/icons @coreui/react availity-reactstrap-validation bootstrap chart.js classnames core-js enzyme enzyme-adapter-react-16 flag-icon-css font-awesome formsy-react formsy-react-components node-sass prop-types react react-app-polyfill react-chartjs-2 react-dom react-moment react-redux react-router-config react-router-dom react-test-renderer reactstrap redux redux-thunk simple-line-icons
npm install --save-dev react-scripts
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
Getting started with Jekyll on Fedora
$ sudo dnf install rubygems rubygem-bundler ruby-devel
$ gem install jekyll bundler json
$ jekyll new myblog
At this point, we need to add json to our Gemfile:
$ cd myblog
$ vim Gemfile
try:
gpsd = gps.gps(mode=gps.WATCH_ENABLE)
while True:
# Read the GPS state from the laptop
gpsd.next()
if (gpsd.valid & gps.LATLON_SET) != 0:
print "Latitude: %s" % gpsd.fix.latitude
print "Longitude: %s" % gpsd.fix.longitude
@somat
somat / nginx.conf
Created October 27, 2017 11:26
Nginx http proxy with ssl example.
server {
listen 80;
server_name api.example.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name api.example.com;
ssl_certificate /etc/letsencrypt/live/api.example.com/fullchain.pem;