Skip to content

Instantly share code, notes, and snippets.

View alexishida's full-sized avatar
👨‍💻
Coding

Alex Ishida alexishida

👨‍💻
Coding
View GitHub Profile
@alexishida
alexishida / zipall.bat
Created April 16, 2024 02:09
Zip multiple files into separate archives (Windows)
FOR %%i IN (*.*) DO "C:\Program Files\7-Zip\7z.exe" a "%%~ni.7z" "%%i"
@alexishida
alexishida / wp-permissions-script
Created April 8, 2024 17:20 — forked from macbleser/wp-permissions-script
WordPress Permissions Configuration Script
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro
#
WP_OWNER=changeme # <-- wordpress owner
WP_GROUP=changeme # <-- wordpress group
WP_ROOT=/home/changeme # <-- wordpress root directory
@alexishida
alexishida / C++_commands.txt
Created October 31, 2023 04:34
C++ commands
# https://code.visualstudio.com/docs/cpp/config-wsl
# https://code.visualstudio.com/docs/cpp/config-linux
sudo apt-get install build-essential gdb
@alexishida
alexishida / Manual Instalação Token GD Starsign CUT Ubuntu.txt
Last active December 21, 2023 18:46
Manual Instalação Token GD Starsign CUT Ubuntu
-----------------------------------------------------------------------------------------------------------------------------
PROCEDIMENTOS PARA INSTALAÇÃO Giesecke & Devrient GmbH StarSign CUT S
Autor: Alex Ishida <alexishida@gmail.com>
Data: 27/10/2023
Versão: 1.0.0.0
-----------------------------------------------------------------------------------------------------------------------------
PASSO 1, instale alguns pacotes disponíveis no repositório oficial do Ubuntu.
-----------------------------------------------------------------------------------------------------------------------------
sudo apt update
@alexishida
alexishida / PulseAudio with Pipewire.txt
Created September 26, 2022 16:37
Configure bluetooth PulseAudio which supports HSP, HFP and A2DP (PulseAudio with Pipewire sound server)
My headset microphone was not detected by PulseAudio and the problem is that my headphones don't have HSP profile,
only HFP profile. After trying for 2 days, I came to the solution of replacing PulseAudio with Pipewire sound server, which supports HSP, HFP and A2DP by itself.
So there will be no need to install any other utility like ofono, phonesim. Also, to be noted that my problem wasn't
resolved even after following all the steps to configure ofono in PulseAudio.
So I came up with the steps to replace PulseAudio with PipeWire.
Here is the detailed article I have written to resolve this problem, the steps of which I'm also adding here. You can follow it and most probably be able to solve your problem.
Bluetooth headset microphone not detected
Open your terminal and follow these steps:
@alexishida
alexishida / atualizacao.sh
Created September 14, 2022 02:06
script para atualizacao de servidores ubuntu
#!/bin/bash
apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get autoremove -y
reboot
@alexishida
alexishida / schedule.rb
Created August 9, 2022 16:10
schedule.rb cron gem whenever rails
env :PATH, "/opt/oracle/instantclient_12_2:#{ENV['PATH']}"
env :LD_LIBRARY_PATH, '/opt/oracle/instantclient_12_2'
env :GEM_PATH, ENV['GEM_PATH']
ENV.each { |k, v| env(k, v) }
env :RAILS_ENV, ENV['RAILS_ENV']
# env :PATH, ENV['PATH']
set :output, error: 'log/whenever_error.log', standard: 'log/whenever.log'
every '20 10 2 * *' do
@alexishida
alexishida / gist:181e2735f4c7d83849a9b774c2466434
Created August 4, 2022 15:26 — forked from buddye/gist:1885520
rjb - Ruby Java Bridge - Loading multiple .jar files, for example, Boilerpipe and Stanford parts of speech tagger
## rjb - Ruby Java Bridge - Loading multiple .jar files, for example, Boilerpipe and Stanford parts of speech tagger
## Works in Ruby 1.9.3 and Nginx with Unicorn. Doesn't work in Phusion Passenger. In unicorn, preload_app has to be false (default)
## 'java' folder is in the root rails folder.
## http://rjb.rubyforge.org/
## For Stanford PoS tagger: ../java/ folder contains: stanford-postagger.jar, left3words-wsj-0-18.tagger
## http://nlp.stanford.edu/software/tagger.shtml
## For Boilerpipe, ../java/ folder contains: boilerpipe-1.2.0.jar, nekohtml-1.9.13.jar, xerces-2.9.1.jar
@alexishida
alexishida / rbenv-uninstall.sh
Last active May 9, 2022 16:19
uninstall rbenv
#!/bin/bash
SCRIPT_USER=$SUDO_USER
# Checking if script running with sudo
if [[ $(id -u) -ne 0 ]]
then echo "Please run with sudo ..."
exit 1
fi
rm -fr /usr/local/rbenv
@alexishida
alexishida / pancake_lottery.rb
Last active March 22, 2022 11:51
PancakeSwap Lottery Odds preview
# frozen_string_literal: true
#!/usr/bin/ruby
require 'securerandom'
numero_sorteado = "781040"
rodadas = 0
acerto_1 = false