Tumgik
riyandika · 2 years
Text
brew install
Right click Terminal from the Application/Utilities folder, Get Info, and tick the "Open using Rosetta" box.
Uninstall Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)" rm -rf /opt/homebrew/* sudo rm -rf /opt/homebrew
Reinstall Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Restart terminal
Check Homebrew is working fine: brew doctor
Reinstall openssl: brew install openssl
Install Ruby: rvm install 2.5.0
0 notes
riyandika · 2 years
Text
Install Jmeter Mac
brew install jmeter
jmeter
0 notes
riyandika · 3 years
Text
MySQL Clone DB
mysqldump -u SOURCE_USERNAME --host=SOURCE_HOST --password='SOURCE_PASSWORD' SOURCE_DBNAME --no-tablespaces | mysql -u TARGET_USERNAME -p TARGET_DBNAME
0 notes
riyandika · 3 years
Text
Logrotate
Rotate log to prevent getting too big
based on: https://gorails.com/guides/rotating-rails-production-logs-with-logrotate
Open /etc/logrotate.conf
add this: /home/deploy/APPNAME/current/log/*.log { daily missingok rotate 7 compress delaycompress notifempty copytruncate }
daily – Rotate the log files each day. You can also use weekly or monthly here instead.
missingok – If the log file doesn’t exist, ignore it
rotate 7 – Only keep 7 days of logs around
compress – GZip the log file on rotation
delaycompress – Rotate the file one day, then compress it the next day so we can be sure that it won’t interfere with the Rails server
notifempty – Don’t rotate the file if the logs are empty
copytruncate – Copy the log file and then empties it. This makes sure that the log file Rails is writing to always exists so you won’t get problems because the file does not actually change. If you don’t use this, you would need to restart your Rails application each time.
run this: /usr/sbin/logrotate -f /etc/logrotate.conf
0 notes
riyandika · 3 years
Text
Folder size
du -h --max-depth=1 /path/to/directory
du -h -d 1 /path/to/directory
0 notes
riyandika · 3 years
Text
grpc PHP Pecl
PHP Warning: PHP Startup: Unable to load dynamic library 'grpc.so' (tried: /usr/lib/php/20190902/grpc.so (/usr/lib/php/20190902/grpc.so: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/grpc.so.so (/usr/lib/php/20190902/grpc.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
the problem is extension and PHP compiled with different API version. Solve this by defining PHP version
pecl -d php_suffix=7.4 install grpc
0 notes
riyandika · 3 years
Text
Rabbitmq Debian 10 Buster
from https://www.rabbitmq.com/install-debian.html#apt-cloudsmith
Shell script
#!/usr/bin/sh apt-get install curl gnupg apt-transport-https -y ## Team RabbitMQ's main signing key curl -1sLf "https://keys.openpgp.org/vks/v1/by-fingerprint/0A9AF2115F4687BD29803A206B73A36E6026DFCA" | gpg --dearmor > /usr/share/keyrings/com.rabbitmq.team.gpg ## Cloudsmith: modern Erlang repository curl -1sLf https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/gpg.E495BB49CC4BBE5B.key | gpg --dearmor > /usr/share/keyrings/io.cloudsmith.rabbitmq.E495BB49CC4BBE5B.gpg ## Cloudsmith: RabbitMQ repository curl -1sLf https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/gpg.9F4587F226208342.key | gpg --dearmor > /usr/share/keyrings/io.cloudsmith.rabbitmq.9F4587F226208342.gpg ## Add apt repositories maintained by Team RabbitMQ tee /etc/apt/sources.list.d/rabbitmq.list <<EOF ## Provides modern Erlang/OTP releases ## ## "bionic" as distribution name should work for any reasonably recent Ubuntu or Debian release. deb [signed-by=/usr/share/keyrings/net.launchpad.ppa.rabbitmq.erlang.gpg] http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/ubuntu bionic main deb-src [signed-by=/usr/share/keyrings/net.launchpad.ppa.rabbitmq.erlang.gpg] http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/ubuntu bionic main ## Provides RabbitMQ ## deb [signed-by=/usr/share/keyrings/io.packagecloud.rabbitmq.gpg] https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/ buster main deb-src [signed-by=/usr/share/keyrings/io.packagecloud.rabbitmq.gpg] https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/ buster main EOF ## Update package indices apt-get update -y ## Install Erlang packages apt-get install -y erlang-base \ erlang-asn1 erlang-crypto erlang-eldap erlang-ftp erlang-inets \ erlang-mnesia erlang-os-mon erlang-parsetools erlang-public-key \ erlang-runtime-tools erlang-snmp erlang-ssl \ erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl ## Install rabbitmq-server and its dependencies apt-get install rabbitmq-server -y --fix-missing
Got some errors
Tumblr media
found this https://stackoverflow.com/questions/23106813/error-with-rabbit-mq-server
Tumblr media
rabbitmq-server start, got some error
Tumblr media
found this https://stackoverflow.com/questions/48674104/clang-error-while-loading-shared-libraries-libtinfo-so-5-cannot-open-shared-o
Tumblr media
solved
0 notes
riyandika · 3 years
Text
Docker Prune
docker image prune
docker volume prune
docker system prune
https://docs.docker.com/config/pruning/
0 notes
riyandika · 3 years
Text
Apache Certbot redirect to WWW
2 vhosts:
non-www vhosts: <VirtualHost *:80>
ServerName example.com
Redirect permanent / http://www.example.com/
</VirtualHost>
www vhosts: your regular yadda-yadda vhosts
a2ensite non-www vhosts
a2ensite www vhosts
certbot
select your warrior
done
0 notes
riyandika · 4 years
Text
Android Debug over Wifi
Source:https://simbeez.com/android/how-to-debug-android-app-over-wifi/
Connect device via USB 
Get list of connected devices adb devices
Restart tcp mode adb tcpip 5555
Find device IP address settings->about->status->IP Address
Connect device to computer adb connect 192.168.1.10 or adb connect 192.168.1.10:5555
disconnect device from computer adb disconnect 192.168.1.10
0 notes
riyandika · 4 years
Text
PHP Cache Header
$cache_length = 86400; // 60 * 60 * 24 $cache_expire_date = gmdate("D, d M Y H:i:s", time() + $cache_length); header("Expires: $cache_expire_date"); header("Pragma: cache"); header("Cache-Control: max-age=$cache_length"); header("User-Cache-Control: max-age=$cache_length"); 
0 notes
riyandika · 4 years
Text
Terminal delete file name contain
find . -name 'ci_session*' -delete
1 note · View note
riyandika · 4 years
Text
Count file inside folder
for i in /var/*; do echo $i; find $i |wc -l; done
1 note · View note
riyandika · 4 years
Text
check free disk space
df
To check inode
df -i
1 note · View note
riyandika · 4 years
Text
Command Prompt IP Scanner
for /L %i in (0,1,255) do ping -n 1 -w 250 192.168.100.%i>>ipaddress.txt
0 notes
riyandika · 4 years
Text
This is incompatible with sql_mode=only_full_group_by
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
0 notes
riyandika · 4 years
Text
Zircote Inheritance and Polymorphism
/**  *  @OA\Schema(  *   schema="Pet",  *   type="object",  *   allOf={  *       @OA\Schema(ref="#/components/schemas/NewPet"),  *       @OA\Schema(  *           required={"id"},  *           @OA\Property(property="id", format="int64", type="integer")  *       )  *   }  * )  */ 
extending schema
0 notes