Skip to content

Instantly share code, notes, and snippets.

🤓
Studying

Ferdinand Mütsch n1try

🤓
Studying
Block or report user

Report or block n1try

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@n1try
n1try / rclone_sync.txt
Last active Sep 16, 2019
Automated Google Drive sync for Linux using rclone
View rclone_sync.txt
Script that will trigger a local to remote sync when any changes below your local Google Drive folder occur - but at max. every 10 minutes - and a remote to local sync every x (e.g. 30 minutes) via a cron job.
0. Install rclone and configure it for Google Drive
1. Create files listed below
2. Configure rclone_watch_local.sh to be run on startup (e.g. using a systemd service unit)
3. Add a cron job that runs rclone_remote2local.sh every x (e.g. 30) minutes
----------------------
rclone_local2remote.sh
----------------------
View qcartpole.py
# Inspired by https://medium.com/@tuzzer/cart-pole-balancing-with-q-learning-b54c6068d947
import gym
import numpy as np
import math
from collections import deque
class QCartPoleSolver():
def __init__(self, buckets=(1, 1, 6, 12,), n_episodes=1000, n_win_ticks=195, min_alpha=0.1, min_epsilon=0.1, gamma=1.0, ada_divisor=25, max_env_steps=None, quiet=False, monitor=False):
self.buckets = buckets # down-scaling feature space to discrete range
View vggfaces_finetuned_model.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View vggfaces_bottleneck_model.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View inspection.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View custom_model.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@n1try
n1try / tripadvisor_scraper.py
Last active Jul 27, 2019
A scraper for restaurant reviews from Tripadvisor
View tripadvisor_scraper.py
'''
A script to scrape restaurant reviews from tripadvisor.com or tripadvisor.de using Selenium.
Author: Ferdinand Mütsch <mail@ferdinand-muetsch.de>
License: MIT
Updated: January, 09 2018
Installation:
- Install `selenium` and `pandas` using pip
- Install PhantomJS or get Chrome- or Firefox webdriver binaries and add them to your PATH (see http://selenium-python.readthedocs.io/installation.html#drivers)
@n1try
n1try / vpn.md
Created Nov 17, 2018
Use FritzBox IPSec VPN on Ubuntu 18.04
View vpn.md

FritzBox VPN on Ubuntu 18.04

  • Configure VPN for a user on your FritzBox and don't forget to show the pop-up including your credentials etc. afterwards. Also make sure you check "Allow access from internet".
  • sudo apt install vpnc network-manager-vpnc
  • Create file /etc/vpnc/vpn.conf, paste the following content and insert your credentials etc.
IPSec gateway yourfritzboxhere.myfritz.net
IPSec ID your_user
IPSec secret your_preshared_key
View dqn_cartpole.py
# Inspired by https://keon.io/deep-q-learning/
import random
import gym
import math
import numpy as np
from collections import deque
from keras.models import Sequential
from keras.layers import Dense
from keras.optimizers import Adam
@n1try
n1try / TwoSum.scala
Created Mar 27, 2019
LeetCode TwoSum Solution Scala
View TwoSum.scala
// https://leetcode.com/problems/two-sum
object TwoSum {
def apply(nums: Array[Int], target: Int): Array[Int] = {
nums.view.zipWithIndex.map(x => {
val el = nums.view.zipWithIndex.drop(x._2 + 1).collectFirst {
case y if y._1 + x._1 == target => y
}
Array(Option(x), el)
}).collectFirst {
You can’t perform that action at this time.