This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run \ | |
--name {{printf "%q" .Name}} \ | |
{{- with .HostConfig}} | |
{{- if .Privileged}} | |
--privileged \ | |
{{- end}} | |
{{- if .AutoRemove}} | |
--rm \ | |
{{- end}} | |
{{- if .Runtime}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
UPSTREAM=${1:-'@{u}'} | |
LOCAL=$(git rev-parse @) | |
REMOTE=$(git rev-parse "$UPSTREAM") | |
BASE=$(git merge-base @ "$UPSTREAM") | |
echo $UPSTREAM | |
echo $LOCAL | |
echo $REMOTE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add these line to the shell rc. | |
alias start_sonarqube=' | |
docker run -d \ | |
--name sonarqube \ | |
--rm \ | |
-p 9000:9000 \ | |
-v sonarqube_extensions:/opt/sonarqube/extensions \ | |
--stop-timeout 3600 \ | |
sonarqube:8.6.0-community | |
' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.akansel.filereader; | |
import java.io.IOException; | |
import java.net.URISyntaxException; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import java.util.Arrays; | |
import java.util.LinkedList; | |
import java.util.List; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can try: | |
sudo bash -c "echo 2 > /sys/module/hid_apple/parameters/fnmode" | |
If it works you can change this permanently (per the linked wiki page): | |
echo options hid_apple fnmode=2 | sudo tee -a /etc/modprobe.d/hid_apple.conf | |
sudo update-initramfs -u -k all | |
sudo reboot # optional |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# resize windows with ALT+RightClick | |
$ gsettings set org.gnome.desktop.wm.preferences resize-with-right-button true | |
# drag window with ALT+LeftClick | |
$ gsettings set org.gnome.desktop.wm.preferences mouse-button-modifier '<Alt>' | |
# change bash to zsh | |
$ which zsh | |
$ chsh | |
# add zsh path to the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// to more performant result, second_collection_field is indexed. | |
db.runCommand({ | |
aggregate: 'first_collection_name', | |
pipeline: [ | |
{ | |
$lookup:{ | |
from: 'second_collection_name', | |
localField: 'first_collection_field', | |
foreignField: 'second_collection_field', | |
as: 'joined_second_collection_array_name' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Go to any week of the course, then open any video | |
// then | |
// open chrome console(cmd+shift+c or F12 or ctrl+shift+c) and paste this content + enter | |
// then copy output to terminal + enter | |
// ATTENTION | |
// replace SET_HERE with your course name in url i.e https://www.coursera.org/learn/COURSE_NAME/home/welcome | |
var courseName = "SET_HERE"; | |
var lessons = document.getElementsByClassName('lesson-name'); | |
for(var i = 0; i < lessons.length; i++){ | |
if((lessons[i].parentElement.getAttribute('aria-expanded') == 'false')) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# color, editor color prefs | |
cp -iv ./.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs <to_rel_path> | |
cp -iv ./.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs <to_rel_path> | |
cp -iv ./.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.editors.prefs <to_rel_path> | |
cp -iv ./.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.ui.prefs <to_rel_path> | |
cp -iv ./.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.jsdt.ui.prefs <to_rel_path> | |
# to workbench layout prefs | |
File > Switch Workspace > Other | |
and copy needed ones |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
generate selfsigned certificate on *nix machines | |
keytool -genkey -keyalg RSA -alias <alias_name_generally_company_product> -keystore keystore.jks -storepass <pass_of_certificate> -validity 360 -keysize 2048 | |
--> | |
<!-- | |
add existing certificate to empty jks | |
keytool -genkey -alias <alias_name_generally_company_product> -keystore keystore.jks | |
keytool -importcert -file <your_.cer_file> -keystore keystore.jks -alias <alias_name_generally_company_product> | |
--> |
NewerOlder