Skip to content

Instantly share code, notes, and snippets.

const logToFile = function(log) {
var file = require('fs').createWriteStream(__dirname + '/debug.log', {flags : 'w'});
file.write(require('util').format(log) + '\n');
};
@ravecat
ravecat / git-svn-sync.sh
Last active May 26, 2020 08:40
[git] Script for sync between git and SVN repos
### Script for sync between git and SVN repos
#!/bin/bash
while [ -n "$1" ]; do
case "$1" in
--commit-ref-name) COMMIT_REF_NAME="$2"
echo "Found the COMMIT_REF_NAME option, with parameter value $COMMIT_REF_NAME"
shift ;;
--commit-sha) COMMIT_SHA="$2"
echo "Found the COMMIT_SHA option, with parameter value $COMMIT_SHA"
@ravecat
ravecat / phone.desktop
Last active February 13, 2021 08:00
android, debian
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=My Phone Android Emulator
GenericName=My Phone Android Emulator
Icon=/opt/android-studio/bin/studio.png
Exec=$HOME/Android/Sdk/tools/emulator -avd <set .ini phone from $HOME/.android/avd>
Categories=Development;Emulator;
@ravecat
ravecat / README.md
Last active May 4, 2024 01:18
debootstrap, livecd

A live CD or live DVD is a complete bootable Linux operating system loaded from a CD or DVD. Although there are a lots of live Linux CDs, for seemingly every taste and purpose, it might still be useful on occasion to build your own. This guide details the steps to build a bootable live CD/DVD based on Debian “wheezy”.

Step 1 – Installing the necessary software

These are the software packages you need to install on your Debian system:

apt-get install xorriso live-build syslinux squashfs-tools

Step 2 – Create a basic filesystem

@ravecat
ravecat / create-debian-remastered-iso.sh
Last active February 13, 2021 07:57
linux, debian
#!/bin/bash
while [ -n "$1" ]; do
case "$1" in
--input) INPUT_ISO="$2"
echo "Found the input iso option, with parameter value $INPUT_ISO"
shift ;;
--file) PRESEED_FILE="$2"
echo "Found the preseed file option, with parameter value $PRESEED_FILE"
shift ;;
@ravecat
ravecat / CustomLink.js
Last active October 17, 2020 20:48
js, react
@ravecat
ravecat / vscode_debugging_chrome
Last active February 22, 2021 09:43
ide, vscode, debugging
{
"type": "chrome",
"request": "launch",
"name": "chrome",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
@ravecat
ravecat / extract_archive
Last active October 17, 2020 20:44
linux, tips
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.xz) unxz $1 ;;
@ravecat
ravecat / bose_bluetooth
Last active October 17, 2020 20:45
linux, bose, bluetooth
I would recommend to clean up you past attempts to pair:
On Ubuntu, remove the headphones from the Bluetooth paired list.
On the headphones, hold the switch in Bluetooth pairing position for 10 seconds to delete all paired devices (You'll get a voice confirmation).
If you can, deactivate Bluetooth on other surrounding devices to make sure they won't interact.
Deactivate Bluetooth LE
Edit Bluetooth configuration file:
sudo nano /etc/bluetooth/main.conf
@ravecat
ravecat / parse_args.sh
Last active December 14, 2020 22:46
bash
function get_help () {
cat << EOF
Help
EOF
}
function handle_kwarg () {
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then