Skip to content

Instantly share code, notes, and snippets.

View ilyesAj's full-sized avatar

ilyes Ajroud ilyesAj

View GitHub Profile
@ilyesAj
ilyesAj / gist:42a387cb16b88063953594b9ddf177de
Last active November 24, 2018 22:10
restore last session on ubuntu 18.04
sudo apt install gnome-shell-extensions
sudo apt-get remove nodejs npm ## remove existing nodejs and npm packages
sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install npm
npm install -g linux-window-session-manager
https://github.com/johannesjo/gnome-shell-extension-window-session-manager
verify if node and npm installed : node -v and rpm -v
to launch : https://itsfoss.com/gnome-shell-extensions/
for docker installation and container :
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
@ilyesAj
ilyesAj / vi.sh
Created January 1, 2020 16:03
set vi on ubuntu
echo "syntax on " >> ~/.vimrc
echo "nocp " >> ~/.vimrc
sudo apt install vim-gui-common vim-runtime -y
@ilyesAj
ilyesAj / tmux.md
Created January 1, 2020 19:44
tmux sheet cheat

using panes :

vertical split : ctrl+b+% horizontal split : ctrl+b+:split window close pane : ctrl+b+x next pane : ctrl+b+o sychronize pane : ctrl+b+:sychronizeOR:sychronize-panes disable sychronization:ctrl+b+:sychronize off

copy text from one terminal to another

  1. enter copy mode : ctrl+b+[
@ilyesAj
ilyesAj / XPS-OEM-UBUNTU.md
Last active July 28, 2022 15:51
XPS 13 OEM ubuntu 20.04-LTS

xps 13

i had long search to complete my ubuntu 20.04 installation on the new dell XPS 13 . here is the steps to have all the things gathered together

  1. install base image ubuntu 20.04 with a usb stick
  2. on the first boot you will have no drivers installed , what you need to do is to connect your PC with an RJ45 (with a usb C to RJ45 adapter) 2.1 launch sudo apt update 2.2 sudo apt upgade
  3. next you will need to install additional drivers so that your system will be Ubuntu Certified :https://certification.ubuntu.com/hardware/202007-28046 3.1 run : apt install linux-oem-20.04
  4. to activate finger print and face recognition : 4.1
@ilyesAj
ilyesAj / external-metric-config
Created June 2, 2022 15:28
external metric for gitlab runner
external:
- seriesQuery: 'gitlab_runner_concurrent{job=~".*gitlab-runner-build.*"}'
resources:
overrides:
namespace:
resource: namespace
name:
matches: "gitlab_runner_concurrent"
as: "gitlab_runner_jobs_builds_concurrent_saturation"
metricsQuery: gitlab_runner_jobs_build_total/sum(gitlab_runner_concurrent{job=~".*gitlab-runner-build.*"})
$ kubectl get --raw "/apis/external.metrics.k8s.io/v1beta1" | jq .
{
"kind": "APIResourceList",
"apiVersion": "v1",
"groupVersion": "external.metrics.k8s.io/v1beta1",
"resources": [
{
"name": "gitlab_runner_jobs_builds_concurrent_saturation",
"singularName": "",
"namespaced": true,
...
hpa:
minReplicas: 1
maxReplicas: 10
metrics:
- type: External
external:
metricName: gitlab_runner_jobs_builds_concurrent_saturation
targetAverageValue: 0.4
@ilyesAj
ilyesAj / gitlab-ci.yaml
Last active June 12, 2022 21:58
ci to to test runner autoscale
job:
parallel: 50
image: alpine:latest
script:
- echo "hello my friend"
- sleep 60
tags:
- k8s,ops