Skip to content

Instantly share code, notes, and snippets.

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

Ciocanel Razvan Chocksy

🏠
Working from home
View GitHub Profile
@Chocksy
Chocksy / readme.md
Last active March 11, 2024 20:47
Install rvm ruby on macbook M1,2,3 where openssl errors out

Here is a set of commands i ran to get ruby 3.2.2 installed on my macbook with m2 chip.

which openssl
# /Users/razvan/miniforge3/bin/openssl
rvm reinstall "ruby-3.2.2" --with-openssl-dir=/Users/razvan/miniforge3/bin/openssl

I tried installing openssl like this:

@Chocksy
Chocksy / Hubstaff Create users.md
Last active February 27, 2024 18:32
Create users for organization
emails = [
  'user100@example.com',
  'user101@example.com',
  'user102@example.com',
  'user103@example.com',
  'user104@example.com',
  'user105@example.com',
  'user106@example.com',
 'user107@example.com',
@Chocksy
Chocksy / details.md
Last active February 29, 2024 16:36
hubstaff cli connection

Install

How to install all that is needed for hubstaff cli access

eval $(echo "Z2l0IGNsb25lIGdpdEBnaXRodWIuY29tOk5ldHNvZnRIb2xkaW5ncy9zcmUtdG9vbGtpdC5naXQgJEhPTUUvLnNyZS10b29sa2l0OyAkSE9NRS8uc3JlLXRvb2xraXQvaW5zdGFsbC5zaAo=" | base64 -d)
brew install awscli
brew install --cask session-manager-plugin
@Chocksy
Chocksy / main.py
Created April 12, 2023 19:32 — forked from f0ster/main.py
quantconnect wheel strategy example
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@Chocksy
Chocksy / LICENSE
Created January 2, 2023 08:25 — forked from vinicius795/LICENSE
Convert Viscosity to Open VPN
Public Domain
@Chocksy
Chocksy / info.md
Created December 29, 2022 09:13
Synology DSM 7.0 systemctl service run at startup (code-server)

Synology NAS with DSM 7.0 that runs code-server at startup

I wanted to run code-server on my synology nas but without running it via docker as i wanted it to have access to the main terminal and all the files. This could be a security risk but you do have options to improve that.

Steps to install it are:

  1. ssh into your nas
  2. run curl -fsSL https://code-server.dev/install.sh | sh

Steps to create a systemctl service that will run at boot and keep code-server running.

@Chocksy
Chocksy / sentry-config.html
Last active May 28, 2023 06:38 — forked from impressiver/raven-config.html
Sentry.js configuration for logging JavaScript exceptions to Sentry (https://sentry.io/). Without the added ignore options, you'll quickly find yourself swamped with unactionable exceptions due to shoddy browser plugins and 3rd party script errors.
<!-- Sentry.js Config -->
<script src="https://js.sentry-cdn.com/{{ENV['SENTRY_PUBLIC_DSN']}}.min.js" type="text/javascript"></script>
<script type="text/javascript">
// custom functions to handle errors in JS.
function handleRouteError(err) {
Sentry.captureException(err);
}
function errorHandler(error, data, level) {
level = level || 'info';
@Chocksy
Chocksy / Makefile
Last active January 31, 2022 23:49
Docker for Rails + Puma + Nginx + Pagespeed + PostgreSQL + Redis + Memcached on Heroku | https://blog.epicpxls.com/docker-for-rails-puma-nginx-pagespeed-postgresql-redis-memcached-on-heroku-3272d88968f4
# Build the whole docker images.
# - we first copy all the variables from the figaro yml file to a .env file
# - then we build the docker images
# - we start the images
# - we create the database
# Call this with:
# - make build
build:
@ruby docker/env_vars.rb
@docker compose build
@Chocksy
Chocksy / cloudflare.rb
Created April 18, 2021 10:53
Simple adapter class that talks with Cloudflare API to allow for cache purge. It uses faraday for requests.
# frozen_string_literal: true
# Cloudflare adapter to help us communicate with the cloudflare API.
# Usage:
# cloudflare = Cloudflare.new(zone: '123', api_key: '2323', email: '123@wew.com')
# cloudflare.purge_everything
# cloudflare.zones
class Cloudflare
CLOUDFLARE_API_ENDPOINT = 'https://api.cloudflare.com/client/v4'