Posts

Jekyll - Ruby 3.0 does not include webrick

Sam
bundle exec jekyll serve When I tried to serve jekyll locally I get this. cannot load such file -- webrick (LoadError) Incremental build: disabled. Enable with --incremental Generating... Jekyll Feed: Generating feed for posts done in 0.196 seconds. Auto-regeneration: enabled for '/Users/i072278/Development/github.com/sirajudheenam/sirajudheenam.github.io/docs' ..../.rvm/gems/ruby-3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve/servlet.rb:3 :in `require': cannot load such file -- webrick (LoadError) Solution: # This is because webrick is no longer a bundled gem in Ruby 3.0. # let us add manually to our project bundle add webrick bundle exec jekyll serve Hurray, It works !

SSH Story

my ssh journey

WD My Cloud Mirror ssh root@X.X.X.X Unable to negotiate with X.X.X.X port 22: no matching host key type found. Their offer: ssh-dss ssh -oHostKeyAlgorithms=+ssh-dss root@192.168.178.20 Add your host key in to ~/.ssh/config Host wdnas HostName 192.168.178.20 HostKeyAlgorithms=+ssh-dss check if the host key already cached # Host X.X.X.X not found in /Users/XXX/.ssh/known_hosts remove the locally cached keys ssh-keygen -R X.X.X.X Check if it works.

Sam
Never date your friend’s spouse, for you expose yourself to death; Before you close the door to sleep, check if you haven’t forgotten something outside; If your friend earns a living, be happy, and the doors will also open your turn; Do not speak too much before your elders, but listen more; If you find a wise father or a wise mother, honor them as parents;

Sam

Sam
Prometheus Setup helm status prometheus NAME: prometheus LAST DEPLOYED: Mon May 27 00:17:37 2024 NAMESPACE: default STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: The Prometheus server can be accessed via port 80 on the following DNS name from within your cluster: prometheus-server.default.svc.cluster.local Get the Prometheus server URL by running these commands in the same shell: export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=prometheus,app.kubernetes.io/instance=prometheus" -o jsonpath="{.items[0].metadata.name}") kubectl --namespace default port-forward $POD_NAME 9090 The Prometheus alertmanager can be accessed via port 9093 on the following DNS name from within your cluster: prometheus-alertmanager.

Important Network Commands in Linux

1. lsof lsof -i To find the process which uses a port 8080, lsof -i :8080 To find the process which uses a TCP port 3005, lsof -i tcp:3005 I often have trouble finding a process which uses a port. I used the lsof command to find the process which uses a port. then I kill the process using the kill command. kill -9 PID

Text processing with awk sed and cut

awk sed and cut - tools to process text data in Linux OS

Sam
awk openstack image list > images.txt +----------------+--------------+-----------+ | ID | Name | Status | +----------------+--------------+-----------+ | 9789-4b3f-95b8 | windows-2012 | active | | 27a3-46c2-b821 | windows-2016 | active | | f45a-4c89-a69f | windows-2019 | active | | 012f-4751-822a | windows-2019 | active | | 68c8-4d4b-a5b5 | windows-2022 | active | +----------------+--------------+-----------+ extract only windows-2016 image id # on a bash or zsh shell ID=`awk '$4=="windows-2016" {print $2}' images.txt` echo $ID 27a3-46c2-b821 # on a fish shell set ID $(awk '$4=="windows-2016" {print $2}' images.

Vim Text editor - tips and tricks

Vim Text editor - tips and tricks in Linux OS

Sam
VIM Tricks # move the current to the above line or swap the current line with previous one ddkP # copy all lines in a file # % - next command to work on all lines # y - yank those lines # + - copy to the system clipboard :%y+ # the other way of copying all lines of code # gg - get the curser to the first line # "*y - to start a yank command to the register * from the first line, until.