Skip to content

Instantly share code, notes, and snippets.

View shubhamwagh's full-sized avatar
🎯
Focusing

Shubham Wagh shubhamwagh

🎯
Focusing
View GitHub Profile
@shubhamwagh
shubhamwagh / ssh_display_forward.md
Last active December 7, 2021 11:33
SSH Display forward
  • Make sure you have xauth installed. (See: xauth info or xauth list)
  • On the server your /etc/ssh/sshd_config file should have these lines:
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost no
  • Make sure on client side you have X server installed.
  • On the client side your ~/.ssh/config file should have these lines if not create new config file and add:
@shubhamwagh
shubhamwagh / bitcoin_mining.md
Last active May 6, 2021 12:32
BitcoinMining-SimplifiedSketch

BitcoinMining explaination

Data

  • Assume this is the hash of the lastest block (shortened to 30 characters): 00000000000001adf44c7d69767585
  • Following are the hashes of a few valid transactions waiting for inclusion (shortened).
5572eca4dd4
db7d0c0b845
  • And this the hash of one special transaction that you just crafted, which gives 10BTC (the current reward) to yourself:
@shubhamwagh
shubhamwagh / TexturedMeshSteps.md
Last active April 24, 2024 14:26
Steps to create textured mesh from point cloud using Meshlab

Steps to create Textured Mesh from Point Cloud using Meshlab

Get your PointCloud into MeshLab

  • Import the pointcloud file in ".ply" file format in Meshlab. Before importing make sure you do some pre-processing / cleaning on point cloud so as to ease the process of meshing.

Point Cloud Simplification and Normals Computation

  • Next we need to reduce the number of point samples for smooth meshing.
    • So go to Filters -> Point Set -> Point Cloud Simplification. Enter Number of samples circa 5% of original number of points. Make sure Best Sample Heuristic is checked.
  • After point cloud simplification, make sure to select Simplified point cloud in the Show Layer Dialog on the right hand side. If not visible, it can be opened by navigating to View -> Show Layer Dialog. Now we need to compute normals for point set.
  • So go to Filters -> Point Set -> Compute normals for point sets . Enter Neighbour num between 10 - 100. Initially try with 10 and
@trongthanh
trongthanh / gist:2779392
Last active April 24, 2024 23:46
How to move a folder from one repo to another and keep its commit history
# source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html
# First of all you need to have a clean clone of the source repository so we didn't screw the things up.
git clone git://server.com/my-repo1.git
# After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command
git filter-branch --subdirectory-filter your_dir -- -- all
# This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command.
@jeromer
jeromer / compassbearing.py
Last active February 21, 2024 13:31
compass bearing between two points in Python
# LICENSE: public domain
def calculate_initial_compass_bearing(pointA, pointB):
"""
Calculates the bearing between two points.
The formulae used is the following:
θ = atan2(sin(Δlong).cos(lat2),
cos(lat1).sin(lat2) − sin(lat1).cos(lat2).cos(Δlong))