Few months back I started looking into gitlab-ci at my workplace, due to part of almost my daily routine task I have now picked up the concept of gitlab-ci and I love it. Now I think of the continuous integration as best and fastest way of deployment. Yesterday I finished my particle photon weather project first stage. Since particle.io provides online IDE I in the beginning started working directly online and editing the code as well which ultimately provided a way to flash the firmware directly to Particle photon or may it be Particle Electron or mesh. So I decided to continuous integration of this particle photon project. It is basically a cpp code and particle provides its own cli tool that makes job a lot easier. Whole picture was clear to me what to do and I wrote the below .gitlab-ci.yml file that will upload code to my particle photon from anywhere no matter where the particle photon is located remotely.

off course if you have particle mcu accessible you can use serial wired upload which is faster CI is only convenient if your mcu is located remotely or if you are lazy.

In the above code I login to particle.io using cli :-particle-q login-u $PARTICLE_USR-p $PARTICLE_PWD
I have saved PARTICLE_USR and PARTICLE_PWD variable in gitlab-ci environment settings. PWD is protected so it never gets echoed.
The above code I wrote as basic boilerplate to start with and it is working perfectly (y)

Few days back I was reading about cardinal numbers and while I was reading about cardinal number, I recall I had a discussion about infinities with a friend last year. The point was some infinities are bigger than other infinities. And how come?

If viewed fro​m mathematical perspective we have a logical explanation . But before I go talking about which infinity is greater lets find out what is cardinality. The term cardinality refers to numbers in a set. Cardinality can be finite or infinite. However the cardinality of the set of real numbers is greater than the cardinality of the set of integers, even though both the sets are infinite.

And based on the Cantor Triangle, which demonstrates that the cardinality of the rational numbers was the same as that of the integers. Both have a cardinality of the aleph-null, the smallest infinity. Real numbers have cardinality of aleph-one.

I bought this particle photon in India last year, but couldn't make good use of it, and it was lying unused so I brought it with me to China thinking I will fiddle with it and do some project . It is after around 11 month of living in Beijing I managed some spare time (when my 16 month son was taking a nap) to setup Particle Photon hooked to DHT22 placed outside my home to monitor outdoor weather.

Having an experience using DHT22 with other Arduino boards I hooked it up quite easily and I made use of thingspeak.io to upload data.

You can have a look at the code I wrote for particle photon to read sensor data. Nothing new just used Adafruit_DHT.h and Thingspeak.h library

Temperature in Beijing, Chaoyang on Nov, 4 2018

I used my javascript skills to write a plugin on thingspeak.io to display temperature in google chart API Gauge . And I opened the google gauge on an old tab and placed it on cupboard, and I am getting live stream of outdoor temperature all the time.

In many companies you may not be allowed to connect to docker hub registry on internet. That is most likely part of security rules. Like this is how in the company ( Base-fx) I am currently working at.

​To set up a proper docker registry would mean the developers who uses images do not pull themselves from docker. Instead they request a departnment to pull the base docker image from docker hub on internet. Lets assume the systems department pulls base docker images do host docker01. This means docker01 machine has access to internet but software developers who need to use docker images can pull from docker01 on there workstations running docker or a dedicated host running docker and acting as private docker registry. In my case i am going to use docker02 host machine to host private docker registry.

docker01 is machine connects to internet

docker02 machine is on internal network of organisation

root@docker01: docker pull hello-world (pull image from docker hub )

root@docker01: docker tag hello-world docker02:5000/myworld

root@docker01: docker push docker02:5000/myworld

Now the above steps maybe required by the devops/ system engineer who had access to host running docker that has access to internet to pull base images from docker hub.

So docker push hello-world pushes to docker . If you want to push to a local registry you need to explicitly tag it with the registry address.

If your local registry is secured, you need to run docker login docker02:5000 but that does not change the default registry. If you push or pull images without registry address in the tag , docker will always use the hub.

So now if you run the command devpi user you will see only one user:root

root is the default user that has /root/pypi is a read-only proxy link to the PyPI repo at https://pypi.org. Its purpose is to install packages when they are not available on your local devpi instance.To upload packages to the local instance, you need to create a non-root user and an index first.

well, just decided to post this out and share it with everyone, quite useful if you want stick with terminal, I tend to use ffmpeg to convert media quite often. I do not know why my TV stopped supporting MKV format, I remember when I bout it it used to play mkv format just fine, but converting to mp4 without losing the quality was was quite convenient.

to convert mkv format to mp4 without losing quality:

ffmpeg -i input.mkv -codec copy output.mp4

This doesn't convert the format it will just convert the container without re-enconding content.

It auto-detects a Matroska to MP4 container conversion based on input/output filenames.

-codec copy stream copies, or "re-muxes", the streams from the input to the output without re-encoding. Think of it like a copy and paste.

Default stream selection behavior is to select only one stream per stream type. For example, if your input has two video streams and one audio stream then only the video stream with the largest frame size will be selected. Add -map 0 if you want to select all streams from the input.

Some containers may not support some formats. So check if your chosen container format, be it mkv, mp4 or even avi has support for all the content in your files (video, audio, subtitles, data, etc). For example, mp4 does not support SubRip subtitles (.srt files).

sips -Z 1080 /Volumes/remotePC/Desktop/100CANON/*.JPG --out /Users/my_mac/Desktop/10CANON/
recently I used sips to convert and copy to my local computer 10 MB to 12MB JPG to few kb(size depends) on the batch.

here is bit of more information if you have never tried sips before and you are mac user.

SIPSmust be one of the simplest and most underrated ways to process images on the mac. I mean, that’s what it’s there for, but it’s like no one thinks about it. I was trying to resize about 500 jpegs today with automator and then I remembered it. SIPS is simpler and faster FTW!
SIPS doesn’t do EVERYTHING, but it does some common functions quickly and nicely and it’s accessible from the command line right in the terminal. Here are some things SIPS can do:#Resize a batch of images to 250px (largest side)sips-Z250*#Resize only .jpg files in a folder to 500px x 500px - ignores aspectsips-z500500*.jpg#Rotate a batch of images 90 degrees clock-wisesips-r90*#Resize down to fit 250 pixels and pad with white to make them square, add finder iconsips-Z250-p250250--padColor FFFFFF-i*There are more things you can do with SIPS – be careful, don’t hurt yourself– SIPSmodifies your files without apology. Experiment on copies or live a life of regret. You can see the man page for more info.
Of course, you could mogrify with ImageMagick, and that is truly wonderful, but not everyone needs or has IM and SIPS works out-of-the-box on any OSX Mac. BTW, SIPS stands for Scriptable Image Processing System, in case you were wondering.

Okay, this is just a short post, I just cannot hold myself to share this useful command awk .

let say you want to delete all docker images with name none.here is how you would do it.docker images -a | grep "<none>" | awk '{print $3}'$3 select the 3rd column of the table dumped on terminal if you run docker images command . which is Image Id.And now since you have image id you can remove them all together like this:

docker rmi `docker images -a | grep "<none>" | awk '{print $3}'`

Likewise what if you want to unmount the drive from USB

if you run df -h the first column is the mounted device, so to select that we would do awk '{print $1}' and unmount

I am tech savvy guy fond of using terminal for everything, the only time I come out of using command line interface is when I have to browse internet . I even create remote repo on GitHub from command line . Coming to the subject of the post. I have a local network setup at home that serves for NAS storage I have connected to Raspberry pi.

So sometimes I download stuff from my macbook instead of downloading on the raspberry pi, and in that case I transfer files from my macbook using rsync a really handy utility that comes bundled .

just run rsync with source and target flag in addition to the following flags .

​my favourite flag in above is -P which will give you progress of the transfer and an estimate time. and second favourite is --bwlimit which is handy if you do not want to choke up the network.

you can also chooser to get rid of source file by using the --remove-source-files flag however I recommend it should be used -a .rsync -a source destination- I let it run once, run it a second time to confirm all the files are moved over and consistent.

By default rsync only checks size and time to determine if a copy is needed, if you want to be really safe you should tell it to use checksums (-c)

Safety is in non destructive processes. Don't delete until you know its all there.

​Another utility I would like to talk about here isiperf

iperf is used for measuring the LAN bandwidth, on the server side you can run iperf -s and on the client side run the command iperf -c server-IP -d and it will dump the file transfer rate supported.

After having walked miles learning from people I met of different societies and culture, I have decided to be quite, calm and move on, passing on with a gentle smile on my face expressing an agreement with onlookers for their righteousness that they believe so.

But the story behind the scene is different. Not quite a bit but absurdly different I believe it is difficult to comprehend.
Because what I believe is not what you believe in. We both have come to a conclusion of a reality that satisfies our belief. Not the actuality.

Belief is not just something that only humans picture to reality, animals to believe what picture they precirve and environment the live and circumstances they go through.

The origin of what wefeel lies deep within our desires. Desires are the drugs that move us from one step to the next and with every step the success experienced is rewarding that we feel driven to take the next step and seek the excitement to our nerves.

So what we do, may it be good or bad ultimately becomes part of our habit and the habits form the repetition cycle.

I have observed that it is the nature of biological beings (and most probably at molecular levels or maybe really law of nature) to what we feel strongly driven in is actually half of the next step already taken. Taking steps to fulfill desire that meets our expectation already seems so fulfilling the joy within starts to show you a blur picture. A joyfull rewarding experience.

And this picture slowly engraves in the neuroplastic brain with formation of more complex neural network. Each action you perform, words you speak will form benchmark of success from previous steps (a lived experience) will always be less harder because by now even your brain knows what to do to succeed. Now I would like to repeat myself, every fulfilling step that meet replenishing desire is easier than before. And now this is what traps us. And this trap is our belief. And our belief is guarded by nothing just what makes us happy. A small picture of reality formed of the world we live in.

To some people eating non-veg feels okay, to some cheating or lying is ok, to some sticking to honesty , discipline or organised is ok and to some violence is the way and to some negotiation by peace seems be the only way. You may think whatever you do is right from your perspective but this is partial truth because what we do is the hard wired neural network formed of a self rewarding gene of selfishness we all posses. You become "used to". I believe this is the saddest thing to say. Because unwillingly you have given up your actually right norm to a what now seems right to you.You are either driven by your belief or by the belief of others. You have become slave of a belief. And you tend to end up living a belief that may not be true. This is an instance in which logical reasoning is superseded by belief. Even if you do what is logically not right will always seems right to you.

What we (you and me) settle to live believing is mere construction of the neural circuit that has shaped inside of our brain. Our brain is composed of 80 to 100 billions of neurons forming a neural network of 1000 to 10,000 synapses or connections. i.e 100 trillions neural connections in human brain. (I am not making it up, I have stumbled through pages of books on nueroscience).

It was in 2014 when neuroscientists engaged in a reconciliation of critical-period studies with the more recent research showing how the brain can, and does, change in response to hitherto unsuspected stimuli. Our belief is merely part of neural circuit formed in the neuroplastic brain inside of our head.

Not the belief but maybe the nature of belief and probably lot other things gets embedded as instructions into our DNA which further becomes part our genetic material that we pass to next generation of reproducing naturally.

So remember you are an outcome of a belief, and the belief posses you. It is impractical and incorrect to say one may not have belief because without belief no reality form the picture of our perception would ever exist. Because "eyes see only what our mind is prepared to comprehend" - French philosopher Henri Bergson

There is no message as I am not and obviously won't be dictating to any one what should be right to do because by now you must have understood that your belief living inside of your head is controlling your actions, behaviour and what you say, that will ultimately decide your fate.

This site contains actual content, written by an actual person. All of this stuff is mine. Even though it may read like it was written by monkeys on typewriters, I actually wrote it. If you want to use my stuff, you can't. At least, not without contacting me first. I also have a privacy policy that I guard fiercely. Any information you provide on this website will not be used by anyone else but me.
Blog, Website Content, VFX Showreel work & Tools & Scripts by Sanjeev Kumar is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

>

Powered by Create your own unique website with customizable templates.