I am father with 2 lovely kids. Daily activities at office, i am working as Sales Engineer at one of cloud provider. I will helping my customer to optimizing, cost efficiency, and grow faster using latest technology .So very warm welcome to IT Enthusiast to see on my blog post. Thank you
I have a scenario project that need to query from my Organization contact list which if the requestor create a new request then the approval which triggered from Microsoft Automate / Flow then approval users it will taken from my Organization contact list
The Organization Contact List schema :
The MS Flow Process as below :
length(Body(‘Filter_array’)) : this is the function that i am need to get total my query from result Filter Array.
I decided post this code in this blog for my reference later if i go back again as Developer 🙂 This Project was a Sharepoint 2016 Project and still used web form asp.net application.
Code the ascx (Usercontrol)
The PrintElem function is to collect the HTML code (see on the var printContents) then transfer to control txtPrint. After are done then call server side function btnExportToPdf_Click (__doPostBack(‘<%=btnExportToPdf.UniqueID%>’, ”);)
2. Reference library
HtmlAgilityPack and iText 7, you can download it from manage nuget on your visual studio.
In the past, companies needed to acquire physical premises and infrastructure to start their business. There was a substantial up-front cost in hardware and infrastructure to start or grow a business. Cloud computing provides services to customers without significant upfront costs or equipment setup time.
These two approaches to investment are referred to as:
Capital Expenditure (CapEx): CapEx is the spending of money on physical infrastructure up front, and then deducting that expense from your tax bill over time. CapEx is an upfront cost, which has a value that reduces over time.
Operational Expenditure (OpEx): OpEx is spending money on services or products now and being billed for them now. You can deduct this expense from your tax bill in the same year. There’s no upfront cost. You pay for a service or product as you use it.
CapEx computing costs
A typical on-premises datacenter includes costs such as:
This area includes all hardware components and the cost of supporting them. When purchasing servers, make sure to design fault tolerance and redundancy, such as server clustering, redundant power supplies, and uninterruptible power supplies. When a server needs to be replaced or added to a datacenter, you need to pay for the computer. This can affect your immediate cash flow because you must pay for the server up front.
This area includes all storage hardware components and the cost of supporting it. Based on the application and level of fault tolerance, centralized storage can be expensive. For larger organizations, you can create tiers of storage where more expensive fault‐tolerant storage is used for critical applications and lower expense storage is used for lower priority data.
Networking costs include all on-premises hardware components, including cabling, switches, access points, and routers. This also includes wide area network (WAN) and Internet connections.
Backup and archive costs
This is the cost to back up, copy, or archive data. Options might include setting up a backup to or from the cloud. There’s an upfront cost for the hardware and additional costs for backup maintenance and consumables like tapes.
Organization continuity and disaster recovery costs
Along with server fault tolerance and redundancy, you need to plan for how to recover from a disaster and continue operating. Your plan should consist of creating a disaster recovery site. It could also include backup generators. Most of these are upfront costs, especially if you build a disaster recovery site, but there’s an additional ongoing cost for the infrastructure and its maintenance.
Datacenter infrastructure costs
These are costs for construction and building equipment, as well as future renovation and remodeling costs that may arise as demands grow. Additionally, this infrastructure incurs operational expenses for electricity, floor space, cooling, and building maintenance.
While not a capital expenditure, the personnel required to work on your infrastructure are specific to on-premises datacenters. You will need the technical expertise and workforce to install, deploy, and manage the systems in the datacenter and at the disaster recovery site.
OpEx cloud computing costs
With cloud computing, many of the costs associated with an on-premises datacenter are shifted to the service provider. Instead of thinking about physical hardware and datacenter costs, cloud computing has a different set of costs. For accounting purposes, all these costs are operational expenses:
Leasing software and customized features
Using a pay-per-use model requires actively managing your subscriptions to ensure users do not misuse the services, and that provisioned accounts are being utilized and not wasted. As soon as the provider provisions resources, billing starts. It is your responsibility to de-provision the resources when they aren’t in use so that you can minimize costs.
Scaling charges based on usage/demand instead of fixed hardware or capacity.
Cloud computing can bill in various ways, such as the number of users or CPU usage time. However, billing categories can also include allocated RAM, I/O operations per second (IOPS), and storage space. Plan for backup traffic and disaster recovery traffic to determine the bandwidth needed.
Billing at the user or organization level.
The subscription (pay-per-use) model is a computing billing method that is designed for both organizations and users. The organization or user is billed for the services used, typically on a recurring basis. You can scale, customize, and provision computing resources, including software, storage, and development platforms. For example, when using a dedicated cloud service, you could pay based on server hardware and usage.
Benefits of CapEx
With capital expenditures, you plan your expenses at the start of a project or budget period. Your costs are fixed, meaning you know exactly how much is being spent. This is appealing when you need to predict the expenses before a project starts due to a limited budget.
Benefits of OpEx
Demand and growth can be unpredictable and can outpace expectation, which is a challenge for the CapEx model as shown in the following graph.
With the OpEx model, companies wanting to try a new product or service don’t need to invest in equipment. Instead, they pay as much or as little for the infrastructure as required.
OpEx is particularly appealing if the demand fluctuates or is unknown. Cloud services are often said to be agile. Cloud agility is the ability to rapidly change an IT infrastructure to adapt to the evolving needs of the business. For example, if your service peaks one month, you can scale to demand and pay a larger bill for the month. If the following month the demand drops, you can reduce the used resources and be charged less. This agility lets you manage your costs dynamically, optimizing spending as requirements change.
Serverless computing lets you run application code without creating, configuring, or maintaining a server. The core idea is that your application is broken into separate functions that run when triggered by some action. This is ideal for automated tasks – for example, you can build a serverless process that automatically sends an email confirmation after a customer makes an online purchase.
The serverless model differs from VMs and containers in that you only pay for the processing time used by each function as it executes. VMs and containers are charged while they’re running – even if the applications on them are idle. This architecture doesn’t work for every app – but when the app logic can be separated to independent units, you can test them separately, update them separately, and launch them in microseconds, making this approach the fastest option for deployment.
Here’s a diagram comparing the three compute approaches we’ve covered.
Finally after 2 days i have been working with this installation. Finally i am completed install Asp.Net Core 3.0 using Nginx as web server then deploy it of one my project on github project https://github.com/agustox21/MovieListCore3 .
Actually that project taken from other github but currently still using Asp.net Core 2. Becaus i am installed Asp.Net Core 3.0, I decide to modify some code then i published to my github so i able to download from my ubuntu server and deploy it.
Create the directory for html_2100 as follows, using the -p flag to create any necessary parent directories:
sudo mkdir -p -p /var/www/movie-app
Next, assign ownership of the directory with the $USER environment variable:
sudo chown -R $USER:$USER /var/www/movie-app
The permissions of your web roots should be correct if you haven’t modified your umask value, but you can make sure by typing:
sudo chmod -R 755 /var/www/movie-app
Now, you can move into the parent directory and clone the application on GitHub:
git clone https://github.com/agustox21/MovieListCore3.git
Now, to build the project and all its dependencies, run the following command:
cd /var/www/movie-app dotnet build dotnet publish
5. Setting Kestrel process
Kestrel is an open source, cross platform, light weight and a default webserver used for Asp.Net Core applications. Asp.Net Core applications run Kestrel webserver as in-process server to handle web request. Kestrel is cross platform, runs in Windows, LINUX and Mac. Kestrel webserver supports SSL. To handle this and ensure that the Kestrel process keeps running in the background, you will use systemd functionalities.
Systemd files will allow you to manage a process by providing start, stop, restart, and log functionalities once you create a process of work called a unit.
Cockpit is a server manager that makes it easy to administer your GNU/Linux servers via a web browser. It makes Linux discoverable, allowing sysadmins to easily perform tasks such as starting containers, storage administration, network configuration, inspecting logs and so on.
Cron, the thing that always heard on my ears for couple year ago. That time i was involved with one project that need a job timer and that time one of the developer used Cron Job instead that usualy we always use it with Job Task Schedule, Sharepoint Job Timer or Sql Job.
What is Cron ?
Cron is a time-based job scheduling daemon found in Unix-like operating systems, including Linux distributions. Cron runs in the background and tasks scheduled with cron, referred to as “cron jobs,” are executed automatically, making cron useful for automating maintenance-related tasks.
So on this demo, i will digging a litte bit about how to install Cron on Ubuntu and test it. Here are the steps as follow :
sudo apt update
sudo apt-get upgrade
2. Install Cron
sudo apt install cron
You’ll need to make sure it’s set to run in the background too:
sudo systemctl enable cron
Done and pretty easy right 🙂 We already installed the Crown and already running as well. So next action are we can use that for scheduling your task job.
Syntax Structure on Cron
Tasks scheduled in a cron are structured like this:
Here’s a functional example of a cron expression. This expression runs the command curl http://www.google.com every Tuesday at 5:30 PM:
30 17 * * 2 curl http://www.google.com
There are also a few special characters you can include in the schedule component of a cron expression to make scheduling easier:
*: In cron expressions, an asterisk is a wildcard variable that represents “all.” Thus, a task scheduled with * * * * * ... will run every minute of every hour of every day of every month.
,: Commas break up scheduling values to form a list. If you want to have a task run at the beginning and middle of every hour, rather than writing out two separate tasks (e.g., 0 * * * * ... and 30 * * * * ...), you could achieve the same functionality with one (0,30 * * * * ...).
-: A hyphen represents a range of values in the schedule field. Instead of having 30 separate scheduled tasks for a command you want to run for the first 30 minutes of every hour (as in 0 * * * * ..., 1 * * * * ..., 2 * * * * ..., and so on), you could just schedule it as 0-29 * * * * ....
/: You can use a forward slash with an asterisk to express a step value. For example, instead of writing out eight separate separate cron tasks to run a command every three hours (as in, 0 0 * * * ..., 0 3 * * * ..., 0 6 * * * ..., and so on), you could schedule it to run like this: 0 */3 * * * ....
Here are some more examples of how to use cron’s scheduling component:
* * * * * – Run the command every minute.
12 * * * * – Run the command 12 minutes after every hour.
0,15,30,45 * * * * – Run the command every 15 minutes.
*/15 * * * * – Run the command every 15 minutes.
0 4 * * * – Run the command every day at 4:00 AM.
0 4 * * 2-4 – Run the command every Tuesday, Wednesday, and Thursday at 4:00 AM.
20,40 */8 * 7-12 * – Run the command on the 20th and 40th minute of every 8th hour every day of the last 6 months of the year.