Skip to content

Instantly share code, notes, and snippets.

View bluetoothfx's full-sized avatar

Syed Refat Al Abrar bluetoothfx

View GitHub Profile
@bluetoothfx
bluetoothfx / Clear docker logs
Created November 20, 2022 22:33
Clear docker logs
Check docker logs:
sudo du -h $(docker inspect --format='{{.LogPath}}' $(docker ps -qa))
Clear docker logs:
sudo sh -c "truncate -s 0 /var/lib/docker/containers/*/*-json.log"
or
sudo sh -c "truncate -s 0 /var/snap/docker/common/var-lib-docker/containers/*/*-json.log" (worked for snap)
#reset commit from local+remote (this is remove remote history and local changes)
> git reset --hard <last_working_commit_id>
> git push --force
#rename last commit message
> git commit --amend -m "your new commit message"
#find and goto a working commit, magic time machine. get your commit id easily
> git reflog
#let's say you commited changes and you think you need to make some change
{
"version": "0.2.0",
"configurations": [
{
"name": "Unity Editor",
"type": "unity",
"path": "${workspaceFolder}/Library/EditorInstance.json",
"request": "launch"
},
{
@bluetoothfx
bluetoothfx / Open_Git_Bash.reg
Created October 26, 2020 22:45
add git bash in windows registry
Windows Registry Editor Version 5.00
; Open files
; Default Git-Bash Location C:\Program Files\Git\git-bash.exe
[HKEY_CLASSES_ROOT\*\shell\Open Git Bash]
@="Open Git Bash"
"Icon"="C:\\Program Files\\Git\\git-bash.exe"
[HKEY_CLASSES_ROOT\*\shell\Open Git Bash\command]
@="\"C:\\Program Files\\Git\\git-bash.exe\" \"--cd=%1\""
@bluetoothfx
bluetoothfx / docker-pure-ftpd (docker-compose.yml)
Last active August 15, 2020 08:57
working sample of ftp with authentication (docker-pure-ftpd)
version: '2'
# Usage example: https://github.com/stilliard/docker-pure-ftpd/wiki/Docker-stack-with-Wordpress-&-FTP
# repo: https://github.com/stilliard/docker-pure-ftpd
services:
ftpd_server:
image: stilliard/pure-ftpd
container_name: pure-ftpd
ports:
@bluetoothfx
bluetoothfx / google_navigation
Created July 27, 2020 23:24
Start Google Navigation from Another app. Navigate from current position to destination
private void startGoogleNavigation(double destLat, double destLng) {
//implement back:
// https://stackoverflow.com/questions/30838812/exit-from-google-maps-intent-in-android
String latitude = String.valueOf(destLat);
String longitude = String.valueOf(destLng);
String uriPath = "google.navigation:q=" + latitude + "," + longitude;
Uri navigationIntentUri = Uri.parse(uriPath);//creating intent with latlng
Intent mapIntent = new Intent(Intent.ACTION_VIEW, navigationIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
//mapIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK & Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
@bluetoothfx
bluetoothfx / flutter - matrix position with column and more
Last active June 12, 2020 02:43
Basic Flutter widget implementation
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
var stars = Row(
# Go to a new directory
# Clone Graphhopper Routing Machine Open Source Project Into directory
# Give docker build command
# Run docker image from build
# By default it will download the Germany Part Routing data
# To check the data carefully look into mapped volume
P.S: When I was writing I didn't find any docker compose file in their repo.
Though it was written.
@bluetoothfx
bluetoothfx / OSRM docker hosting
Last active April 16, 2020 12:54
Docker hosting OSRM backend & front end
# Open a folder & start to run below commands from terminal
# download desired map segment (example Germany)
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
# Pre process data - Step 01
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
# Step 02
> docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-partition /data/berlin-latest.osrm
@bluetoothfx
bluetoothfx / mogodb docker-compose
Created April 15, 2020 03:50
use mongodb as test database
# reference
https://medium.com/faun/managing-mongodb-on-docker-with-docker-compose-26bf8a0bbae3