Skip to content

Instantly share code, notes, and snippets.

Avatar

sytrus-in-github

View GitHub Profile
@sytrus-in-github
sytrus-in-github / ubuntu_install_notes.md
Last active Nov 22, 2017
Stuff that I have done to to have a nice running ubuntu 16.04 on my Dell laptop without the hassle of some strange behaviors.
View ubuntu_install_notes.md

Ubuntu 16.04 on Dell inspiron 15 7000 gaming

Ubuntu installation

  1. download Ubuntu system .iso file.
  2. prepare a usb key (better usb3 for speed, will be formatted but the storage space can be easily recovered)
  3. use rufus to unpack the iso file to the usb key
  4. branch the usb key to the computer
  5. restart, then press F12,
  6. turn off the secure boot option
View install_without_sudo.md

get package without installing with sudo

  1. get .deb package. (using e.g. apt-get download (package_name))
  2. unpack package with ar x *.deb
  3. unpack binary with tar xvzf data.tar.gz
  4. run usr/bin/(binary_name) and hope everything works :)

Summarized based on this answer in askubuntu

@sytrus-in-github
sytrus-in-github / hackerRankInputTemplate.python
Last active Apr 25, 2017
template to get input from HackerRank problems for Python
View hackerRankInputTemplate.python
# get number of tests and iterate through each tests
## Python 3
t = int(input().strip())
for _ in range(t):
## Python 2
t = int(input().strip())
for _ in range(t):
@sytrus-in-github
sytrus-in-github / testColorfulQuiver3d.py
Created Apr 14, 2017
example script for matplotlib(2.0.0) quiver 3d custom coloring for each arrow
View testColorfulQuiver3d.py
# tested with python 2 + matplotlib 2.0.0
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
import numpy as np
def getMaxXYZ(vec3ds):
mx, my, mz = vec3ds[0]
for (x, y, z) in vec3ds:
mx, my, mz = (max(x, mx), max(y, my), max(z, mz))
@sytrus-in-github
sytrus-in-github / ROS_tuto_summary.md
Last active Dec 12, 2020
A cheat-sheet-like summary of the ROS tutorial
View ROS_tuto_summary.md

ROS tutorial summary

1 ROS environment management

1.1 check ROS environment

printenv | grep ROS

1.2 setup ROS environment (can be added to ~/.bash_profile for autosetup on each login)

source /opt/ros/<distro>/setup.bash (for Bash, don't use sth else like setup.sh!)

2 ROS (catkin) workspace management

2.1 create ROS (catkin) workspace

mkdir <path_to>/<workspace_name>/src

@sytrus-in-github
sytrus-in-github / gsync
Last active Nov 3, 2016
A handy function for Git console to synchronize your local/remote repo. Usage: paste the function in file ~/.profile or ~/.bashrc. (or c:\Users\[your_name]\.bash_profile for Windows users)
View gsync
function gsync() {
echo "*** Synchronizing current repo ***"
echo
echo "=== adding all ..."
git add .
echo
echo "=== committing all ..."
git commit -a -m "$1"
echo
echo "=== pulling ..."
@sytrus-in-github
sytrus-in-github / json2js.py
Created Apr 25, 2016
A python script to transform JSON data file to JavaScript file so that the data can be loaded on local machine with <script> tag. A browser-independent workaround of local JSON file access problem.
View json2js.py
import json
def json2js(jsonfilepath, functionname='getData'):
"""function converting json file to javascript file: json_data -> json_data.js
:param jsonfilepath: path to json file
:param functionname: name of javascript function which will return the data
:return None