Unclassified interesting Tech Material - page 6

40..
Something has gone bad in the HTML for this page... 
Shifting to next page: 
https://swlearninglog.blogspot.com/2022/05/unclassified-interesting-tech-material.html


41.
Best jq examples I have seen so far:
https://www.baeldung.com/linux/jq-command-json

42.
Video editor for linux:
https://itsfoss.com/best-video-editing-software-linux/
https://filmora.wondershare.com/video-editor/free-linux-video-editor.html


43.
Merge MKV files linux:
https://linux.die.net/man/1/mkvmerge

This is a super cool utility
very fast :D


44.
Mac current Shell variable:
https://www.macinstruct.com/tutorials/how-to-tell-what-shell-your-mac-is-using/

45.
Apple M1 breaking stuff left-right-center 

- node gyp install error mac m1:
-- https://www.google.com/search?q=node+gyp+install+error+mac+m1&oq=node+gyp+install+error+mac+m1&aqs=chrome..69i57.13691j0j4&sourceid=chrome&ie=UTF-8
-- https://github.com/nodejs/node-gyp/issues/2586
-- 

- fatal error 'vips/vips8' file not found mac m1:
-- https://stackoverflow.com/questions/66363572/vips-vips8-file-not-found-include-vips-vips8-in-ionic-cordova-in-ios

- cannot complile sharp on m1:
https://github.com/lovell/sharp/issues/2460
-- some effort to fix it: https://sharp.pixelplumbing.com/install#apple-m1

- building for ios simulator but linking in dylib built for ios file for architecture arm64 m1
-- https://narlei.com/development/apple-m1-xcode-error-when-build-in-simulator/
-- very nicely summarizes the issue:
https://blog.sudeium.com/2021/06/18/build-for-x86-simulator-on-apple-silicon-macs/









-- conveys the sentiment..developer gone mad due to all of this
-- -building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64 apple silicon
-- the solutions here do not work - Rosetta mode -- compiles but does not run simulator
https://developer.apple.com/forums/thread/667156
https://forum.ionicframework.com/t/sample-app-crashes-on-apple-silicon-m1-when-run-on-x86-platform/209013
-- did not work:
https://serveanswer.com/questions/building-ionic-cordova-app-for-ios-on-m1-mac

-- this too does not work:
https://narlei.com/development/apple-m1-xcode-error-when-build-in-simulator/
-- none of these work as well:
https://milanpanchal24.medium.com/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios-file-for-8c0cc28ec832


- firebasecode.h not found mac m1
-- https://stackoverflow.com/questions/69945264/transfer-to-apple-m1-xcode-shows-an-error-firebasecore-firebasecore-h-file-no


- how to open terminal in rosetta mode:
-- this was tricky to find:
https://apple.stackexchange.com/questions/428768/on-apple-m1-with-rosetta-how-to-open-entire-terminal-iterm-in-x86-64-architec
-- have not tried this one:
https://www.bigbinary.com/learn-rubyonrails-book/setting-up-mac


- uninstalling pods and res-installing them also did not work:
https://guides.cocoapods.org/using/getting-started.html
https://guides.cocoapods.org/using/getting-started.html#sudo-less-installation
-- In terminal type: pod deintegrate.
-- In terminal type: pod clean.


46.
Clickjacking testing tool
https://clickjacker.io/


47.
Building ionic for an M1 mac / apple silicon

- gist: ionic cli sets-up the project build config correctly - so for the first time build with cli and then  you are free to build with any architecture.
https://ionicframework.com/docs/developing/ios#running-with-the-ionic-cli

Build steps:
here:

- setup the project with "npm install"
- then setup the platform with "ionic cordova platform add ios"
- then prepare "ionic cordova prepare ios"
- then you need to setup cli build for ios 
- install ios-sim and ios-deploy: https://ionicframework.com/docs/developing/ios#ios-sim--ios-deploy
ios-sim is an easy npm install; already included in the package.json file
- if there is an error for ios-sim (add binary for the package to the $PATH variable; /home/<username>/<rest-of-the-abs-path>/node_modules/ios-sim/bin --> this directory contains the binary)
- for ios-deploy - you need brew
- install brew as a local install - https://docs.brew.sh/Installation#untar-anywhere
- add brew to your path (give on the above link)
- then use brew to install ios-deploy to your local directory
ios-deploy - definitely needs to be added to ($PATH; add the complete absolute path for the folder containing the binary for ios-deploy)
- the setup may ask you to install native-run (it as already present in the package.json) please add the path to native-run to the $PATH global env variable
- find out the id of the simulator you want to run with: ionic cordova emulate ios --list --verbose

- then run: ionic cordova run ios --target="<id-of-the-simulator>"

-x-x-x-

some files to be created:

and bash.rc (bash_profile)

-x-x-x-
export NVM_DIR="/<home>/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm

## this adds brew path to env
eval "$(~/homebrew/bin/brew shellenv)"

## this adds native-run to the build path
export PATH=$PATH:/<to-project>/Project/<project-name>/node_modules/native-run/bin
-x-x-x-


48.
Abuse of .well-know directory to distrivute malware / ransomware.

https://www.zscaler.com/blogs/security-research/abuse-hidden-well-known-directory-https-sites

Why do people have so much free time in life :( and decide to destructive things in that time :(


49.
Named groups in regular expressions (reg-ex)     

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Ranges#using_named_groups


50.
Almost a selling page for Katalon but good insights on Testing 

https://katalon.com/resources-center/blog/devops-testing-strategy



51.
Url shortner services

https://short.io/pricing
- seems like a decent match with our requirements
- also has the listing api available !!

https://tinycc.com/customize-short-url-plans

- their enterprise plan of 1million links at 139$ is also almost on par with cuttly
- the broken link monitor is definitely a plus
- has the listing of urls as well in the api !

https://t2mio.com/pricing
- third good candidate found with listing api !
- pricing is also reasonable


https://cutt.ly/url-shortener-features 
- was almost the final choice, since high volume of branded links was needed
- but others on top were found after almost finalising this one :D         

https://developers.kaleyra.io/docs/url-shortener-apis
- all required apis present but 
- pricing not openly available


https://app.rebrandly.com/plan
- too pricey for 1 lakh urls

https://bitly.com/pages/pricing
- too pricey for 1 lakh url

https://www.clickmeter.com/pricing-signup
- too pricey for our volume

https://tinyurl.com/app/pricing
- no listing api
- weird plans for what we are required to do..
- not a very good match on the plans differentiation

https://linklyhq.com/#linkly-features
- not matching quiet in the features we desire in the service

https://sniply.io/pricing/
- pricey for our volume

https://www.bl.ink/pricing/
- no good plan available in our desired bracket

-x-x-x-x-x-
Was not in the mood to host.. 
But here are the options
https://github.com/738/awesome-url-shortener#self-hosting-opensource
would have hosted this:
https://github.com/thedevs-network/kutt



52.
Working with iframes in cypress

https://www.cypress.io/blog/2020/02/12/working-with-iframes-in-cypress/


Cypress best practices / code structure betterment:
https://dev.to/bornfightcompany/page-object-pattern-reusable-functions-in-cypress-35jj (why use page objects)
https://www.cypress.io/blog/2019/01/03/stop-using-page-objects-and-start-using-app-actions/
https://dev.to/bornfightcompany/page-object-pattern-reusable-functions-in-cypress-35jj

- build testing only selectors so that tests do not break sue to cosmetic changes
(data-test-selector="name-input")
great idea.. I don't have the blog link where I read this.. but an amazing idea.. I would like to give credit to.


53.
Adding brand logo to email with a BIMI record
https://support.google.com/a/topic/10911234


54.
Optimizing your AWS-Elastic Load Balancer bill:


- If you expect different services to receive different amounts of traffic, it's smart to add the frequently used services first, as your load balancer bill depends in part on the number of rule evaluations. If the most frequent services are defined first, less rules are evaluated in total. (Note however that about $0.008 per hour get you 1000 rule evaluations per second, so will be only noticeable if you have a lot of traffic).
https://pfisterer.dev/posts/multiple-domains-aws-lb




55.
Get source client IP address behind an AWS Elactic Load Balancer


  • For Application Load Balancers and Classic Load Balancers with HTTP/HTTPS listeners, the X-Forwarded-For HTTP header captures client IP addresses. You can then configure your web server access logs to record these IP addresses.

https://aws.amazon.com/premiumsupport/knowledge-center/elb-capture-client-ip-addresses/


56.
In App Updates: 

https://developer.android.com/guide/playcore/in-app-updates

https://www.techdevil.in/implement-android-in-app-update-api-in-react-native/


57.
Remove the Server header from ngnix response for security hardening:

- very concise:
https://kodemonk.dev/blog/setting-custom-sever-header-in-nginx
- most convenient: 
number 2.

  • load_module modules/ngx_http_headers_more_filter_module.so;
    - add above to nginx.conf file
    https://stackoverflow.com/a/62932565
    
  • Add more_clear_headers Server; under http section.

documentation:
https://github.com/openresty/headers-more-nginx-module#readme
https://www.nginx.com/resources/wiki/modules/headers_more/#more-clear-headers

To remove this info from the error messages / pages from nginx:
https://ubiq.co/tech-blog/hide-nginx-server-version-header/ 


If you want to set it from your backend / server that is being proxies by nginx:
https://stackoverflow.com/a/9253190

proxy_pass_header Server;

and nginx will stop processing the header (not tried it, but will try when needed)

Another nice collection of things that can be done to suppress the header:
https://www.getpagespeed.com/server-setup/nginx/how-to-remove-the-server-header-in-nginx

new in this one:
-x-x-x-x-
Option 1. Use NGINX-MOD

An easy way to complete hiding of NGINX presence on the server is using NGINX-MOD.
Simply specify the following in the configuration:


server_tokens none;

-x-x-x-x-x-



load_module modules/ngx_http_security_headers_module.so;

http {
...
security_headers on;
...
}


58.
Content Security Policy header: very good security feature; pain to setup

https://content-security-policy.com/
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy

Setting up on nginx:
https://content-security-policy.com/examples/nginx/

For iframe content:
https://content-security-policy.com/frame-ancestors/
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-src

For hoe to specify sources:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/Sources#sources


59..
Using a javascript library in typescript without type declarations:

https://medium.com/@steveruiz/using-a-javascript-library-without-type-declarations-in-a-typescript-project-3643490015f3

- gist:
-- try your luck here: https://github.com/DefinitelyTyped/DefinitelyTyped
-- or add a type.d.ts to your path and declare the high-level module (you will at least be able to use the library, without the type goodness)


60.
Nice online IDE.
https://ide.codingblocks.com/web


61.
How to exit a nodejs program:
https://nodejs.dev/learn/how-to-exit-from-a-nodejs-program

very nicely described.
Something worth noting:
A program will gracefully exit when all the processing is done.
- use signals to perform cleanup before terminating
- process.exit --> closes the program immediately - even if some processing is pending
- return good error codes :)


62.
Capacitor propaganda page :D
https://ionic.io/resources/articles/capacitor-vs-cordova-modern-hybrid-app-development


63.
ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).


- atleast one of your plugins is using ui-webview

- best solution I could think of..

  • grep the node_modules --> for uiwebview
  • make a list of all plugins using it
  • check if you have the latest versions of those plugins
  • if you don't have the latest version - update to the latest versions
    (hopefully this has been upgraded in the plugin, all active plugins have upgraded)
  • remove platform, node_modules
  • reinstall, add platform, prepare the build 
  • hope for the best :D
    (worked for me)
Tip: make sure to use cordova-ios: ^6.0.0
https://cordova.apache.org/announcements/2020/06/01/cordova-ios-release-6.0.0.html
https://ionicframework.com/docs/v3/wkwebview/
- this is the first version where uiwebview was removed

If you cannot upgrade to 6.0.0
for 5.x you can follow this:

Add <preference name = "WKWebViewOnly" value = "true" /> to your config.xml file

from:
https://stackoverflow.com/a/59051458


64.
get current shell running on a linux terminal 

echo $SHELL

- don't know how many times I have used this.. but still forget and have to google 

65.
Chitthi na koi sandesh and build gayab
@apple developer platform / app-store connect - no email from apple for app rejection

https://stackoverflow.com/questions/39567555/new-build-disappears-after-uploading-it-to-itunes-connect

- can confirm that this really does happen - 26th Feb 2022
- then then run in a ll wild directions to figure out the reason
- slow clap apple


66.
Get a reference to a window (if it was named at the time of opening)
Neat trick  - use  "windowName" in window.open

From:
https://developer.mozilla.org/en-US/docs/Web/API/Window/open#syntax

var window = window.open(url, windowName, [windowFeatures]);


Providing an empty string for url is a way to get a reference to an open window by its name without changing the window's location. Otherwise the call to window.open() will just create a new window.


67.
Nice idea of encapsulation:
https://www.skyflow.com/

- but I have not seen anyone build access and security control once the data is on disk. :(
Almost impossible to implement.

68.
docker composer + cypress - to run e2e tests in containers:
https://mtlynch.io/painless-web-app-testing/


69.
Online development environments:
https://www.gitpod.io/
https://aws.amazon.com/blogs/aws/aws-cloud9-cloud-developer-environments/
TODO:
- need to add more options here.

70.
How to install nodejs and npm.
- nvm --> since it is in bash
- n
- nodesource ppa


Seems like all methods are currently well maintained, just depends on the developers choice of style I guess.
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04
https://linuxize.com/post/how-to-install-node-js-on-ubuntu-18.04/
https://github.com/nvm-sh/nvm

A developer has complained that n sometimes screws up the existing version if the script somehow fails to load the new version, not experienced it yet.
https://stackoverflow.com/a/54210201


71.
Linux manage service using systemd:
https://www.linode.com/docs/guides/start-service-at-boot/
https://medium.com/@benmorel/creating-a-linux-service-with-systemd-611b5c8b91d6

both are nice starters the systemd library has a lot of features that can be utilised to manage system services across distributions. 


72.
To have space or not to have space:

I like to have space between code blocks that do different things:

https://eslint.org/docs/rules/block-spacing


73.
Linux: Running a command as another user:

Eg:
sudo -u www-data ./http-app.py

https://unix.stackexchange.com/a/327445


74.
Cross-shell prompt: Starship
https://github.com/starship/starship
https://starship.rs/


Dunno what would prompt anyone to build this :P
But it is awesome !!

and fonts to go with that:
https://www.nerdfonts.com/font-downloads


75.
HTML to pdf in the nodejs ecosystem:
https://github.com/marcbachmann/node-html-pdf

uses
https://www.npmjs.com/package/phantomjs

Error:
error write epipe html-pdf
- not solved yet, just randomly pops up sometimes
suggested: https://stackoverflow.com/questions/34882328/error-write-epipe



76.
Cordova error: failed to fetch platform cordova-ios@^5.0.0 or cordova-ios@^6.2.0

- get solved by upgrading / reinstalling cordova
npm install cordova


77.
Keeping company-wide notes and documents 

https://www.nuclino.com/pricing


78.
Looking for android TV development board:

Found only this one yet
https://www.hardkernel.com/shop/odroid-xu4-special-price/
- the hardware specs are almost same as most of the TVs out there.
About the series:
https://en.wikipedia.org/wiki/ODROID



79.
CA Agile Requirements Designer - Test case modeller
https://techdocs.broadcom.com/us/en/ca-enterprise-software/devops/agile-requirements-designer/2-10/getting-started.html

Demo:
https://youtu.be/f2WPjaQunAQ

How to download:
https://knowledge.broadcom.com/external/article/9613/how-to-download-agile-requirements-desig.html


Could not find pricing...
.... a few moments later... 

Now I know why:
https://www.broadcom.com/how-to-buy/partner-distributor-lookup
Delloit and Wipro are the dealers.


Would like to find out something in the open source world that does a good job of this.



80.
Copy file path and line number for single and multiple line directly from VSCode

https://marketplace.visualstudio.com/items?itemName=ezforo.copy-relative-path-and-line-numbers&ssr=false#overview


Very nice plugin:
- but thank you microsoft.. the plugin code is not present on any public repository.
- had to download the extension and hack into it to see the contents
https://docs.microsoft.com/en-us/visualstudio/extensibility/preparing-extensions-for-windows-installer-deployment?view=vs-2022#to-extract-files-from-an-existing-vsix-package
- seems like a well written implementation, have offered to put it in as an open source project.. let's see..



81.
ESLint disable for a line

// eslint-disable-next-line no-use-before-define
var thing = new Thing();

Or use the single line syntax:

var thing = new Thing(); // eslint-disable-line no-use-before-define



from: 
https://stackoverflow.com/a/29592334


82.
Don't know why these pages are getting slow to edit, weird :
https://sanyamsjournal.blogspot.com/2021/09/trinkets-of-thoughts-pg-5_8.html


90% chance.
Something I have inserted in the DOM here that is making things slow here so changing the page.
next page:

https://sanyamsjournal.blogspot.com/2021/12/unclassified-interesting-tech-material.html


83.

Simple http server in node

https://www.npmjs.com/package/http-server


similar ones exist in php,

$ php -S localhost:8000


python 
https://docs.python.org/3/library/http.server.html

python -m http.server 8000


84.
Useful react native packages

react native document picker 
https://www.npmjs.com/package/react-native-document-picker

react native image picker
https://www.npmjs.com/package/react-native-image-picker


85. 
Online IDE as backups:
https://github.com/features/codespaces
https://docs.github.com/en/codespaces


I think github has hit the right business model.. 
cloud, browser IDE + CI / CD


A nice intro video:
https://www.youtube.com/watch?v=gANADdb_cs0


86.
Python online IDE - CodeHS
https://codehs.com/editor/sandbox/explore/python


87.
Always wanted to try out a few docker alternates:

#1
https://www.containiq.com/post/docker-alternatives

Podman
LXD
Containerd
Buildah
BuildKit
Kaniko


#2
https://jfrog.com/knowledge-base/the-basics-7-alternatives-to-docker-all-in-one-solutions-and-standalone-container-tools/

  1. Artifactory Docker Registry
  2. LXC (Linux)
  3. Hyper-V and Windows Containers
  4. rkt (works with Kubernetes)
  5. Podman (open-source container engine)
  6. runC (portability solution)
  7. containerd (a container runtime)


88.
Mathematics animation library:

https://github.com/ManimCommunity/manim/


89.
Nice libraries to introduce your product:
Angular:
https://www.npmjs.com/package/ngx-joyride

React:
https://www.npmjs.com/package/react-native-joyride

I am sure there are other similar packages out there :)
https://www.npmtrends.com/react-native-joyride-vs-ngx-joyride


90.
To be continued:

Angular application testing:

- protractor + 


91.
Load testing frameworks:

in javascript:
https://k6.io/docs/#use-cases


in python:
https://locust.io/


92.
React Native - update version number of app 
Slow clap react native. Why do we need to change it in 2 places ?
https://stackoverflow.com/a/35925343

https://stackoverflow.com/questions/35924721/how-to-update-version-number-of-react-native-app


93.
kworker process in linux - how to debug and troubleshoot


https://linuxx.info/what-is-a-kworker-process-in-linux/

- kernel process worker
- spawned to carry out kernel level tasks
- how to debug :
-- get kernel version; install kernel-tools for the particular version
-- record ~ 10 seconds of logs 
-- the should help pin-point the issue


94.
Elastic Search - Kibana / Open Search - Error: elasticsearch keyword field not exists even for a text / string field 

- got solved with a refresh of index pattern - (could lose the priority of display... ) but that is okay for most of the cases.

General documentation:
https://www.elastic.co/guide/en/elasticsearch/reference/current/keyword.html


95.
Elastic Search - Kibana / Open Search - very good APIs and auto-complete on dev tools 

Dev tools url:
<domain/path>/app/dev_tools#/console

- awesome auto-complete



96.
Why is it that the app version code for a React Native app has to be updated at 2 places ?
- couldn't find any good way to do it :(
- React Native ---- slow clap :D


97.
React native - how to build - url dump (haven't sorted it out)

https://www.instamobile.io/android-development/generate-react-native-release-build-android/
https://reactnative.dev/docs/environment-setup
https://reactnative.dev/docs/running-on-device
https://proandroiddev.com/bundling-react-native-during-android-release-builds-ec52c24e200d
https://www.decoide.org/react-native/docs/signed-apk-android.html


98.
Ionic app error: "connection to server was unsuccessful"

  1. Your code/data/image is of too much of size ( I guess in your case you are using some images ,as you said you made some UI modifications, may be the size of images are high)
  2. Your script may have a infinite or long loop, so that it takes too much of time to load.
  3. You will be using too much of scripts (jQuery, iscroll, etc etc.. more number of plugins or scripts )

from: https://stackoverflow.com/a/12322945

4. one of the file references (script / images) was not copied to the resources folder or is being referenced from storage 


Threads:

https://stackoverflow.com/questions/41487348/how-to-fix-the-connection-to-the-server-was-unsuccessful-file-android-asset

https://stackoverflow.com/questions/12319809/application-error-the-connection-to-the-server-was-unsuccessful-file-andr

-x-x-x-x-

Solution if it is timeout related:

If the issue is not uniform for all devices and is not happening for latest / higher-end phones .
It is most likely a timeout issue.

<preference name="loadUrlTimeoutValue" value="700000" />

to your config.xml file immediately after this line

<platform name="android">
from: https://stackoverflow.com/a/55275126


99.
Excellent screen + voice recorder

https://obsproject.com/ - amazing software overall 
https://obsproject.com/wiki/install-instructions#linux

I'm gonna start to record videos now,  for sure !! 
grammar :D


Honorable mentions:
https://www.linux.com/topic/desktop/5-screen-recorders-linux-desktop/
https://itsfoss.com/best-linux-screen-recorders/
https://getsharex.com/


 100.
Currying in javascript 
nicely explained
https://www.youtube.com/watch?v=vQcCNpuaJO8



continued from:
https://swlearninglog.blogspot.com/2021/05/unclassified-interesting-tech-material.html

Comments

Popular Posts