Groups, pages and websites that is nice to know when you start programming - Ask questions, contribute open source, be part of the community
Most of the pages are in Hebrew
| # measure command time in seconds (replace <command>) | |
| start=`date +%s%N`;<command>;end=`date +%s%N`;echo `expr $end - $start`/1000000000 | bc | |
| # get all groups | |
| compgen -g | |
| getent group | |
| cut -d: -f1 /etc/group | |
| # get all users | |
| compgen -u |
| // for this purpose we used the icon propery of our tree object to identify that it is a file (a folder doesn't have an icon, it uses the default one) | |
| var customTreeSort = function(a, b) { | |
| if (this.get_node(a).icon === 'jstree-file' && this.get_node(b).icon === 'jstree-file') { | |
| // organize files | |
| return this.get_text(a).localeCompare(this.get_text(b)); | |
| } else { | |
| // files before folders | |
| if (this.get_node(a).icon === 'jstree-file') { | |
| return -1; |
| Windows Registry Editor Version 5.00 | |
| ; To allow installing chrome extensions (crx) from sources other then chrome web store, add this registry to your computer | |
| ; And don't forget to change the urls to your private chrome store | |
| [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallSources] | |
| "1"="http://webstore.mysite.com/ChromeExt/*" | |
| "2"="http://another-source.mysite.com/ChromeExt/*" |
| -- based on http://www.microshell.com/database/mysql/emulating-nextval-function-to-get-sequence-in-mysql/ | |
| -- might be needed | |
| -- SET GLOBAL log_bin_trust_function_creators = 1; | |
| CREATE TABLE `sequence_data` ( | |
| `sequence_name` varchar(100) NOT NULL, | |
| `sequence_increment` int(11) unsigned NOT NULL DEFAULT 1, | |
| `sequence_min_value` int(11) unsigned NOT NULL DEFAULT 1, | |
| `sequence_max_value` bigint(20) unsigned NOT NULL DEFAULT 18446744073709551615, |
| # the node app retrieves the jwt token | |
| # result in: upload-amo-result.json | |
| echo "curl https://addons.mozilla.org/api/v3/addons/{%%%ADDON_UUID%%%}/versions/%%%ADDON_VERSION%%%/ -XPUT --form 'upload=@C:/firefox-addon.xpi' -H 'Authorization: $(node index.js)'" | sh | |
| # result in: status-amo-result.json | |
| echo "curl https://addons.mozilla.org/api/v3/addons/%%%UPLOADER_MOZILLA_DEV_MAIL%%%/versions/%%%ADDON_VERSION%%%/uploads/%%%UPLOAD_PK%%%/ -H 'Authorization: $(node index.js)'" | sh |
| Get-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False} -Properties "SamAccountName", "DisplayName", "msDS-UserPasswordExpiryTimeComputed" | Select-Object -Property "SamAccountName", "Displayname",@{Name="ExpiryDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}} | Where-Object {$_.ExpiryDate -like '*1601*'} |
| @rem save the script wherever you'd like to | |
| @rem create a shortcut named "wifi" and put it in a place that's in your path (shortcuts folder, system32, whatever..) | |
| @rem set the shortcut to run as administrator! IMPORTANT! | |
| @rem run "wifi on" or "wifi off" and enjoy your life. | |
| @rem the default wifi interface name is "Wireless Network Connection" just cause that's the way it's on my computer. | |
| @rem you can run "wifi-set-on-off.bat" script without any parameters to see what's your wifi interface name (I've added "Wi" filter assuming it will be WiFi or wireles..) | |
| @ECHO OFF |
| var jwt = require('jsonwebtoken'); | |
| module.exports = { | |
| getJwtToken : function(issuer, secret) { | |
| var issuedAt = Math.floor(Date.now() / 1000); | |
| var payload = { | |
| iss: issuer, | |
| jti: Math.random().toString(), | |
| iat: issuedAt, | |
| exp: issuedAt + 60, |
| @echo off | |
| @rem throw this file in jetbrains installation folder, it takes the last created WebStorm folder (the latest ide update) for the script | |
| FOR /F "delims=" %%i IN ('dir /b /ad-h /t:c /od -filter "WebStorm*"') DO SET a=%%i | |
| SET WebStormPath=C:\Program Files (x86)\JetBrains\%a%\bin\WebStorm64.exe | |
| echo %WebStormPath% | |
| echo Adding file entries |
Groups, pages and websites that is nice to know when you start programming - Ask questions, contribute open source, be part of the community
Most of the pages are in Hebrew