Skip to content

Instantly share code, notes, and snippets.

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

Konstantin Le flashfoxter

🏠
Working from home
View GitHub Profile
@flashfoxter
flashfoxter / shadowsocks-server.service
Created January 30, 2024 05:18 — forked from guyskk/shadowsocks-server.service
shadowsocks server systemd service
[Unit]
Description=Shadowsocks Server
After=network.target
[Service]
ExecStart=/usr/local/bin/ssserver -c /etc/shadowsocks/ss-config.json
Restart=on-abort
[Install]
WantedBy=multi-user.target
@flashfoxter
flashfoxter / steps.md
Created April 17, 2021 08:46 — forked from mraaroncruz/steps.md
Get the Telegram channel ID

To get the channel id

  1. Create your bot with botfather
  2. Make you bot an admin of your channel

New improved next steps

  1. Go to https://web.telegram.org
  2. Click on your channel
  3. Look at the URL and find the part that looks like c12112121212_17878787878787878
  4. Remove the underscore and after c12112121212
@flashfoxter
flashfoxter / AddPDFMakerOption_mac.md
Created January 17, 2021 15:00 — forked from JohannesHoppe/AddPDFMakerOption_mac.md
How to fix “Compile error in hidden module: AddPDFMakerOption” on Excel for Mac

Caused by Acrobat DC, which installs an add-on that causes the error.

  1. Open the following folder: ~/Library/Group Containers/UBF8T346G9.Office/User Content/Startup/Excel
  2. Remove SaveAsAdobePDF.xlam
@flashfoxter
flashfoxter / docker-git-post-receive.sh
Created October 15, 2020 10:18 — forked from Aukhan/docker-git-post-receive.sh
A sample git post-receive hook to deploy with docker. Use the latest commit hash as image tags to make sure the latest gets pulled always, assumes services were deployed using docker stack deploy.
#!/bin/bash
PREFIX="MY CLIENT -"
REPO_PATH='/home/ubuntu/server/client'
ACCEPTABLE_BRANCH="DEV"
COMPOSE_FILE="docker-compose.production.yml"
CLIENT_IMAGE="127.0.0.1:5000/mpc_nginx_client"
@flashfoxter
flashfoxter / post-receive
Created June 26, 2020 08:10 — forked from lemiorhan/post-receive
Post-receive hook to deploy the code being pushed to production branch to a specific folder
#!/bin/bash
target_branch="production"
working_tree="PATH_TO_DEPLOY"
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then

How to install OpenSTF in Ubuntu 14.04

  1. Add Add RethinkDB key

     source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
     wget -qO- https://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
    
  2. Install packages

sudo apt-get update && sudo apt-get install -y git nodejs nodejs-legacy npm rethinkdb android-tools-adb python autoconf automake libtool build-essential ninja-build libzmq3-dev libprotobuf-dev git graphicsmagick yasm stow

#install oracle java https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
#ANDROIDSTUDIO
#necessary for mksdcard
sudo apt-get install lib32stdc++6
@flashfoxter
flashfoxter / git-deployment.md
Created May 19, 2020 14:25 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@flashfoxter
flashfoxter / embedded-file-viewer.md
Created January 17, 2020 07:19 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@flashfoxter
flashfoxter / async-python.py
Created April 12, 2019 21:06 — forked from pkazmierczak/async-python.py
asyncio example (python3 & python2)
import asyncio
@asyncio.coroutine
def factorial(name, number):
f = 1
for i in range(2, number + 1):
print("Task %s: Compute factorial(%d)..." % (name, i))
yield from asyncio.sleep(1)
f *= i