- right click on the top side bar to move side bars on the left or the right
- if Cmd+click doesn't go to definition:
- Restart TS server:
Cmd+Shift+P→ "TypeScript: Restart TS Server"
Tuesday, February 24, 2026
kursor
Monday, June 23, 2025
Thursday, March 13, 2025
Saturday, January 18, 2025
gradle
- https://www.baeldung.com/gradle
- In a typical Gradle project, each subproject or module usually has its own
build.gradlefile. Here's a general overview:
- Root Project: The root directory of your project contains a
build.gradlefile that defines the overall build configuration. - Subprojects/Modules: Each subproject or module within the root project has its own
build.gradlefile. This allows you to define specific build configurations for each subproject
- build Elastic
- ~/elasticsearch-src-8.16.0$ ./gradlew localDistro
Sunday, December 1, 2024
Elastic 8 java client aggregations
Aggregation innerAggregation = new Aggregation.Builder()
.terms(t -> t
.field("inner_field")
.size(10)
)
.build();
// Create the outer aggregation and add the inner aggregation to it
Aggregation outerAggregation = new Aggregation.Builder()
.terms(t -> t
.field("outer_field")
.size(5)
)
.aggregations("inner_agg", innerAggregation)
.aggregations("inner_agg2", innerAggregation)
.build();
Friday, July 26, 2024
Ubuntu 24 display problem
I just installed a new Ubuntu 24. When I run file manager, I lack pieces of the display like text and icons. Most of them appear with a mouse over.
A work around is to select the x.org x server as shown below. But once you do that, you cannot suspend Ubuntu anymore
Note: after doing the instruction here below, I got back my correct display (but still cannot awake successfully after suspend)
sudo apt-get update
sudo dpkg --configure -a
sudo apt-get install update-manager-core
Friday, May 24, 2024
IntelliJ
- to edit a file in column mode
- right click and select "column mode"
- to manage JVMs
- File / Project Structure
- Platform Settings
- or right click on any library in the project "External Libraries" section and then "Open Libraru Settings"
Sunday, January 21, 2024
Python string format / print
>>> print('We are the {} who say "{}!"'.format('knights', 'Ni'))
We are the knights who say "Ni!"
The brackets and characters within them (called format fields) are replaced with the objects passed into the str.format() method. A number in the brackets refers to the position of the object passed into the str.format() method.
>>> print('{1} and {0}'.format('spam', 'eggs'))
eggs and spam
>>> print('This {food} is {adjective}.'.format(food='jam', adjective='absolutely horrible'))
This spam is absolutely horrible.
Positional and keyword arguments can be arbitrarily combined:
>>> print('The story of {0}, {1}, and {other}.'.format('Bill', 'Manfred', other='Georg'))
The story of Bill, Manfred, and Georg.
b) using f-strings (need Python 3.6)
titi = 15
print() can take 255 parameters. When using '+' is a way to have a single parameter is used.
>>> percentage = 0.23456789
>>> '{:2.2%}'.format(percentage)
'23.46%'def print(self, *args, sep=' ', end='\n', file=None)
Monday, January 15, 2024
Jupyter notebook
- start
- "jupyter notebook"
- from ~/tools/jupyter. (to be able to retrieve jupyter projects)
Monday, December 4, 2023
vscode / vs code
- select a column / rectangle
- click once on the top position
- alt + shift + keep left click mouse to select a colum
- cmd + shift + P: Open the Command Palette (`Ctrl+Shift+P` on Windows/Linux)
- "Chat: Open chat": to get copilot right panel
- "View: Toggle Terminal" (show console at the screen bottom)
- or pull it up from the bottom bar with your mouse
- cmd + shift + V: display a readme.md
- cmd + shift + F: find on the overall project
- cmd + shift + E: show where the file is in the folder tree (or select a file while on the explorer view)
- .
- cmd + S: format file when the Prettier extension is installed, like "save"
- cmd + F: search in file
- cmd + P: search a file by its name
- cmd + . : show quick fix
- cmd + , : settings
- .
- settings (cmd + shift + P: Preferences: open user settings (JSON)
- ~/Library/Application Support/Code/User/settings.json
- disable autocompletion in txt files
- "[plaintext]": {
- "editor.suggest.showSnippets": false,
- "editor.suggest.showWords": false,
- "editor.acceptSuggestionOnCommitCharacter": false,
- "editor.acceptSuggestionOnEnter": "off"
- }
- gitlens / code lens
- "GitLens: Open Settings"
- extensions
- theme: darkula
- GitLens
- ESLint: corrections
- Prettier
- keys on Mac while editing
- ctrl + - go back to previous location
Tuesday, November 21, 2023
codium editor
Codium is like "VS Code" but without Microsoft prorpietary parts.
- select a rectangle on MacOS:
- set the cursor on the line
- keep pressed "alt ⌥" + "cmd ⌘" and use the down arrows
- edit
Thursday, May 20, 2021
jbd2 causing a lot of disk access
Symptom: jbd2 very active in iotop:
221 be/3 root 0.00 B/s 60.87 K/s 0.00 % 38.90 % [jbd2/sda2-8]
sudo chmod -x /etc/cron.daily/mlocate
root@arau3:~# more /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda2 during installation
UUID=d6852e87-0e39-44a1-a431-6f23456f1250 / ext4 commit=60,errors=remount-ro 0
1
Monday, May 3, 2021
atom editor
My packages:
- pretty-json
Insert a carriage return:
- switch to regexp mode and put \n in the "replace" zone
Select a rectangle
- If you want to select a rectangular region in atom all you have to do is first set the horizontal dimension by selecting some text, then set the vertical dimension by holding CTL-SHIFT and then pressing the up or down arrow.
Alternatively you can do this the other way around and set the vertical dimension first with CTL-SHIFT, then let go of CTL but keep holding SHIFT and then use the right or left arrow to select the horizontal dimension.
.
HTML link pointing to a HTML anchor
HTML Anchor:
<a name="overview.description">
you can point to this anchor within the HTML:
<a href="#overview.description">Description</a>
or through a URL link:
https://lucene.apache.org/core/7_7_1/core/overview-summary.html#overview.description
Sunday, April 11, 2021
Re-install Windows 10 on Asus
Asus R457UV
re-installer Windows via clé USB. (disque dur remplacé par exemple). Besoin du user bios admin. Si un user admin bios a deja ete installé et que l'on ne se souvient pas du mot de passe, il faut reprogrammer l"EEPROM sur la carte mere sur ce modele.
La clé Windows est en dur sur la carte mere Asus. Elle n'est plus fournie ni à l'utilisateur ni au constructeur. C'est la politique de Windows pour éviter les fraudes.
2. Bios / Boot / Fast Boot = Disabled
3. Bios / Boot / Launch CSM = Enabled
4. F10 + Yes
5. Bios / Boot / Boot Option Priority = Clé USB
6. F10 + Yes
Monday, May 25, 2020
Docker on mac
- https://docs.docker.com/docker-for-mac/
- you can install rancher desktop that configures what is necessary on the machine
- start the "docker desktop" app from the finder
- no free "docker licence" for companies > 250 people
- https://apple.stackexchange.com/questions/435962/running-docker-daemon-on-apple-silicon-without-docker-desktop
- docker desktop includes
- Docker Engine (acts as a client-server application)
- Docker CLI client
- Docker compose
- ( https://docs.docker.com/desktop/ )
- brew install docker
- brew install docker-machine
- brew install --cask virtualbox. (not sure if we need this)
- docker pull elasticsearch:7.7.1
- brew list
- . docker
- . docker-machine
- docker info
- Client:
- Context: default
- Debug Mode: false
- Plugins:
- buildx: Docker Buildx (Docker Inc., v0.8.2)
- compose: Docker Compose (Docker Inc., v2.6.1)
- extension: Manages Docker extensions (Docker Inc., v0.2.7)
- sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
- scan: Docker Scan (Docker Inc., v0.17.0)
- Server:
- Containers: 23
- Running: 1
- Paused: 0
- Stopped: 22
- Images: 57
Monday, May 6, 2019
Multiple git accounts
Some possible "git config --list" options are "--local" and "--global"
If you don't specify --global, it takes the local config by default.
git config --list
Before you commit, you need to be sure you are using the correct one.
You can set it by doing:
The local config will be saved in .git/config
The global config is saved in ~/.gitconfig
_______ git clone
git config --global --list
- You can use
- git clone XX -c user.name=toto -c user.email=toto@toto.com (this will set .git/config)
- or
- git config --global user.name "xxx"
- git config --global user.mail "xxx"
- git clone git@github.com:youruser/myj-gh (need ssh keys)
Tuesday, April 16, 2019
Google services empty the battery
Google Services is making continuous network access and empty the battery. It stops when network is disabled.
solution: register for the Google Services beta program. That's the only way to update/change Google Services
.
Thursday, February 14, 2019
Mac survival kit
- ask different
- fonctionnalities, F keys. To be able to debug in vscode for example
- fn + F12. go to dashboard (calendar, calculator)
- by default F7, F8 don't workon intelliJ
- System Preferences > Keyboard > function keys > Use F1,F2 as function keys
- about .bash_profile
- MacOS (formerly OS X) is based on BSD Unix
- list of installs made:
- less /Library/Receipts/InstallHistory.plist
- machine info
- sysctl -n machdep.cpu.brand_string
- system_profiler | grep Processor
- system_profiler
- updatedb
-
(base) lee@a8:~$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
- (base) lee@a8:~$ sudo /usr/libexec/locate.updatedb
- (base) lee@a8:~$ locate logs
- install kdiff3
- brew cask install https://raw.githubusercontent.com/Homebrew/homebrew-cask/6a96e5ea44803e52a43c0c89242390f75d1581ab/Casks/kdiff3.rb
- if you need to untar things like mvn, you can do so in /usr/local using sudo. Other folders are protected even using sudo
- colors
- console and vi:
- go to terminal (console) / preferences / Profiles / Basic / ANSI Colors
- change them
- brew
- brew list
- brew doctor
- brew services list
- brew services info docker-machine
- brew services start tomcat
- brew install --cask warp (cask specify that it is an app)
- which bash / zsh ?
- echo $0
- set bash as the default shell
- echo '/opt/homebrew/bin/bash' | sudo tee -a /etc/shells
- chsh -s /opt/homebrew/bin/bash
- zsh
- ps -ef, htop prefered
- sometimes buggy, switch to bash
- ex: find . |grep ".py"|xargs grep fill (not working on my zsh)
- this works on zsh but not on sh for big files
- sort -u toto.txt > out.txt
- list open ports
- lsof -nP -iTCP -sTCP:LISTEN
- network (use bash)
tcpdump -n -A -p -i lo0 host 127.0.0.1 > tcp-tmp.txt
list open ports
- netstat -anvp tcp | awk 'NR<3 || /LISTEN/'|grep 8080
- java
- install Java
- brew install openjdk@17
- sudo ln -sfn /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk
- echo 'export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"' >> ~/.zshrc
- JAVA_HOME="$(/usr/libexec/java_home -v 20)"
- installed JVM
- lee@al8:~/dev/nemo-etab-etl$ /usr/libexec/java_home -V
- Matching Java Virtual Machines (3):
- 17.0.10 (x86_64) "Oracle Corporation" - "Java SE 17.0.10" /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home
- 15.0.2 (x86_64) "Oracle Corporation" - "Java SE 15.0.2" /Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home
- 11.0.7 (x86_64) "Oracle Corporation" - "Java SE 11.0.7" /Library/Java/JavaVirtualMachines/jdk-11.0.7.jdk/Contents/Home
- /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home
- ll /Library/Java/JavaVirtualMachines/
- switch version, just change JAVA_HOME
- # export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-11.0.7.jdk/Contents/Home"
- export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home"
- keychain / Password app
- recently the keychain part app was transformed into the password app
- but the hided key chain app can still be accessed by searching "Keychain Access" in the finder window search bar
- Finder
- cmd + shift + .(period) to display dot files
- Terminal
- cmd + i : allows to change color / title of tabs
- audio device stuck
sudo pkill -9 coreaudiod
Tuesday, February 5, 2019
install nvidia driver on Ubuntu
https://websiteforstudents.com/install-proprietary-nvidia-gpu-drivers-on-ubuntu-16-04-17-10-18-04/
lshw -c video
(driver for NVidia GK107GL [Quadro K600]:
sudo apt install nvidia-346)
.