Skip to content

Instantly share code, notes, and snippets.

@seyuf
seyuf / console-hotfix.md
Last active September 4, 2019 13:54
Elasticsearch "blocked by: [FORBIDDEN/12/index read-only / allow delete (api)" error

Override index closing when available disk space is less than 5%

curl -XPUT 'http://localhost:9200/_cluster/settings' -H "Content-Type: application/json" -d '{ "persistent" : { "cluster.routing.allocation.disk.threshold_enabled" : false } }'

Unlock from read from read-only state

curl -XPUT 'http://localhost:9200/_all/_settings' -H "Content-Type: application/json"   -d '{ "index.blocks.read_only_allow_delete": null }' 
@seyuf
seyuf / github-actions-trick.yml
Last active September 18, 2019 14:20
Trick Github Actions: Pull docker image from private registry
- uses: docker://[ref-to-public-image]
- name: "pull private image and retag it"
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_REGISTRY_URL: ${{ secrets.DOCKER_REGISTRY_URL }}
run: |
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" ${{ secrets.DOCKER_REGISTRY_URL }}
docker pull [url-of-private-image]
docker tag [url-of-private-image] [ref-to-public-image]
@seyuf
seyuf / xmodmap for apple magic keyboard (debian 9)
Created October 19, 2019 18:58
keybaord mapping for apple magic keyboard on debian 9
keycode 8 =
keycode 9 = Escape NoSymbol Escape
keycode 10 = ampersand 1 UF8FF dead_acute
keycode 11 = eacute 2 ediaeresis doublelowquotemark
keycode 12 = quotedbl 3 leftdoublequotemark rightdoublequotemark
keycode 13 = apostrophe 4 leftsinglequotemark rightsinglequotemark
keycode 14 = parenleft 5 braceleft bracketleft
keycode 15 = section 6 paragraph aring
keycode 16 = egrave 7 guillemotleft guillemotright
keycode 17 = exclam 8 exclamdown Ucircumflex
@seyuf
seyuf / xkbmap for apple magic keyboard (debian 9)
Created October 19, 2019 19:01
Xkb mapping for apple magic keyboard (fr/azerty) on debian 9
xkb_keymap {
xkb_keycodes "evdev+aliases(azerty)" {
minimum = 8;
maximum = 255;
<ESC> = 9;
<AE01> = 10;
<AE02> = 11;
<AE03> = 12;
<AE04> = 13;
<AE05> = 14;
@seyuf
seyuf / xmod-to-xkb.md
Last active October 19, 2019 19:14
Convert xmodmap to xkbmap

1.Load the current xmodmap file

  • xmodmap ~/.Xmodmap
  1. Generate xkb mapping file
  • xkbcomp $DISPLAY $HOME/.xkbmap
  1. Load xkb mapping
  • xkbcomp /home/madalien/.xkbmap ":0"
@seyuf
seyuf / ohai.gif
Last active November 8, 2019 18:59
Bonjour
ohai.gif
@seyuf
seyuf / m2-cache-cleaner-errors.md
Last active January 6, 2020 12:04
Magento cache cleaner tool issues

Magento Cache Clean v 1.0.13

Issues when modifying registration.php file


Test Env: Magento 2.1.11 |

@seyuf
seyuf / polygon-center-calculator.js
Last active January 9, 2024 03:04
Calculate GeoJson polygon center in javascript
function area(poly){
var s = 0.0;
var ring = poly.coordinates[0];
for(i= 0; i < (ring.length-1); i++){
s += (ring[i][0] * ring[i+1][1] - ring[i+1][0] * ring[i][1]);
}
return 0.5 *s;
}
@seyuf
seyuf / dell-bios-upgrader
Last active December 7, 2020 13:10
upgrade dell bios with dead battery
### bios flash without battery in WinPE
Run 3521A12.exe with wrong parameter (e.g. writehdrfile)
Wait for error window, but don't close it.
Go to %temp% folder.
Find folder with name looks like - 7zS62A4.tmp
Copy it to somewhere.
Close error window.
Edit platform.ini: replace BatteryCheck=1 to BatteryCheck=0
Run InsydeFlash.exe