AWS |
AWS Compute Blog |
Efficiently Scaling kOps clusters with Amazon EC2 Spot Instances |
https://aws.amazon.com/blogs/compute/efficiently-scaling-kops-clusters-with-amazon-ec2-spot-instances/
|
Efficiently Scaling kOps clusters with Amazon EC Spot InstancesThis post is written by Carlos Manzanedo Rueda WW SA Leader for EC Spot and Brandon Wagner Senior Software Development Engineer for EC This post focuses on how you can leverage recently released tools to optimize your usage of Amazon EC Spot Instances on Kubernetes Operations kOps clusters Spot Instances let you utilize unused capacity … |
2022-01-10 18:50:22 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
ハッシュを指定した順番に出力したい【Ruby】 |
https://teratail.com/questions/377552?rss=all
|
ハッシュを指定した順番に出力したい【Ruby】知りたいこと配列を順番に出力したいです。 |
2022-01-11 03:37:01 |
技術ブログ |
Developers.IO |
Automate File Handling using Python and Boto3 in AWS |
https://dev.classmethod.jp/articles/automate-file-handling-using-python-and-boto3-in-aws/
|
Automate File Handling using Python and Boto in AWSWhat are we trying to do We might have a directory that s very cluttered and we need to organise it and back |
2022-01-10 18:39:58 |
海外TECH |
Ars Technica |
Canon can’t get enough toner chips, so it’s telling customers how to defeat its DRM |
https://arstechnica.com/?p=1824817
|
canon |
2022-01-10 18:12:24 |
海外TECH |
MakeUseOf |
How to Use Google Forms to Create an Interactive Workflow |
https://www.makeuseof.com/tag/use-google-forms-create-interactive-workflow/
|
How to Use Google Forms to Create an Interactive WorkflowGoogle Forms is the office workflow interface you didn t know you needed Use Google Forms to collect information and in the next step add details or trigger a process |
2022-01-10 18:16:40 |
海外TECH |
MakeUseOf |
4 Things to Consider When Buying a Digital-Only Console |
https://www.makeuseof.com/buying-tips-digital-only-console/
|
buying |
2022-01-10 18:16:40 |
海外TECH |
MakeUseOf |
How to Use the for Loop in a Linux Bash Shell Script |
https://www.makeuseof.com/for-loop-in-shell-script/
|
script |
2022-01-10 18:01:11 |
海外TECH |
DEV Community |
MovieFlixer 🚀 |
https://dev.to/rohitdhas/movieflixer-al0
|
MovieFlixer Overview of My SubmissionMovieFlixer is a web app where you can search for your favorite movies and shows you can Buy those movies and also rate them out of Submission Category E Commerce Creation Link to Code rohitdhas Dev Hackathon MovieFlixer Search Buyand rateyour favorite movies and shows Movie Flixer Search and Rate your Favorite Movies and shows Getting startedRequirementsNode js v NPM v Installationgit clone cd frontendnpm installcd backendnpm installNOTEYou ll need a env file in the backend directory It looks like this PORT MONGO URI Database connection StringEMAIL Your EmailPASSWORD Your PasswordStarting the applicationcd frontendnpm run devcd backendnode server js View on GitHub Additional Resources InfoI built the frontend of this app withNext JS TypeScript Tailwind CSSAnd the Backend withNode JSExpress JSNodemailerStripeMongoDB How I built this Web AppFirst of all I created a database and imported some free sample data provided by mongodb to build my application Then I built an Express Server and created few API routes so that I can simply make API calls from frontend to perform CRUD operations on the data in the database And lastly built the frontend with Next JS and Tailwind CSS to present data coming from DB neatly to user Key Features of this Web App Search Autocomplete Implemented using Atlas Search Autocomplete is pretty handy because it predicts whatever you want to type even if you make silly typos like here I typed kong fu pa and it guessed correct movie name How it works Whenever you start typing in the input field it makes a request to an API endpoint along with the input string That API endpoint aggregates data based on input string using an Aggregation Pipeline with search stage and then sends the results in response And finally those search results are being used to render autocomplete list on frontend Mailing System Implemented using Realm Triggers amp FunctionIn this web application you receive an email on rating a movie or on successfully purchasing a movie For both the cases the logic is almost same To achieve this I am making use of Database triggers which automatically responds based on certain events So When you rate a movie it inserts a document in ratings collection On this insert operation the trigger fires and executes a Realm Function which is making an API call telling the server to send an email to the given mail address You should receive an email like this after rating a movie Also when you click on Proceed to Purchase button it inserts a document in purchases collection and then after your checkout session is successfully completed it updates the corresponding document in DB Now on this update operation the trigger fires and executes a Realm Function which helps the app to send an email You should receive an email like this after buying a movie Now here s the link to my project Go ahead and explore rest of the application MovieFlixer URLAnd please let me know your thoughts on it below |
2022-01-10 18:34:33 |
海外TECH |
DEV Community |
CRUD API with Fastify, Postgres, Docker |
https://dev.to/francescoxx/crud-api-with-fastify-postgres-docker-1df3
|
CRUD API with Fastify Postgres DockerHi I am Francesco You can find me on Twitter here Creating Content in PublicAll this Content has been created during livestreams from scratchHere is the link if you wanna take a look on how I created this content Even this article as it s part of the content itself Part Part In this article we will set some CRUD API using Node js JavaScript Runtime Engine Fastify Fast and low overhead web framework for Node js Postgres PostgreSQL is a free open source relational database very popular and stable Docker Platform to deploy applications using containers GitHub Repository NODENode is a back end JavaScript runtime environment which means briefly that can execute JavaScript code on a computer for example yours or the one where Node is installed The good thing is that by having Docker you DON t actually need to install it because we will use the Node image and so we can also avoid versioning between my version of Node installed on my machine and yours FASTIFYFastify is a web framework focused on performance It is inspired by Hapi and Express and it s for sure one of the fastest web frameworks in town POSTGRESPostgres PostgreSQL is a free open source relational database very popular and stable DOCKERDocker is a platform to build run and share application using the idea of containers If you want a brief introduction here is a short video Step by StepCreate a folder named fastify postgres docker and enter into itmkdir fastify postgres docker amp amp cd fastify postgres dockerInitialize node application using npmnpm init yInstall the dependenciesnpm install fastify fastify postgres pgCreate the app folder and enter into itmkdir app amp amp cd appFrom inside the src folder create a server js file and a route js fileThe folder structure should look like thisLet s write the server js fileconst fastify require fastify logger true fastify register require fastify postgres connectionString postgres process env POSTGRES USER process env POSTGRES PASSWORD process env POSTGRES SERVICE process env POSTGRES PORT process env POSTGRES DB fastify register require routes Run the serverconst start gt fastify listen err address gt if err fastify log error err process exit start Fastify uses the idea of plugins you can check more about this hereLet s write the first part of the routes js fileasync function routes fastify options Testing route fastify get async request reply gt return hello world module exports routes DOCKERNow the Docker Part In the main folder create files Dockerfiledocker compose yml dockerignore it starts with a dot the dockerignore file node modules gitignore envthe Dockerfile FROM node EXPOSE Use latest version of npmRUN npm install npm latest gCOPY package json package lock json RUN npm install no optional amp amp npm cache clean force copy in our source code last as it changes the mostWORKDIR usrCOPY CMD node app server js The docker compose yml file version services fastify backend container name fastify backend image francescoxx fastify backend build context ports env file env depends on postgres postgres container name postgres hostname postgres image postgres ports restart always env file env volumes fastify volume var lib postgres datavolumes fastify volume replace the image francescoxx fastify backend with an image name of your choice Before running our services we need to create a env file to store our environment variables and populate it with all the environment variables we need POSTGRES USER francescoPOSTGRES PASSWORD dbpasswordPOSTGRES DB fastifydbPOSTGRES SERVICE postgresPOSTGRES PORT The End file should look something like this you can change them accordingly on your needings Let s start the postgres service docker compose up d postgreswe should have a Postgres DB up and running let s check what is inside the DB From another Terminal typedocker exec it postgres psql U francesco fastifydband once we are inside the container you can verify this by checking the postgres terminal connect to the fastifydb database c fastifydbthis means that a database named fastifydb has been created by postgres using the environment variable we have passed at the beginningand then dtand you should get the message Did not find any relations This is because we have created the database using the environment variable but we haven t created any table or relationship yetType exit to exit from this terminalexitAnd you are again at your terminalTime to build our image from the folder where the docker compose yml file is located rundocker compose buildNow it s time to run our node applicationdocker compose up d fastify backendWE can verify if both the containers are running by using the docker ps a commandLet s add an endpoint to init the DB This could be done in other better ways In the route js file let s add a simple endpoint that will create the users table INIT TABLE Launch just once to create the table fastify get initDB req reply gt fastify pg connect onConnect function onConnect err client release if err return reply send err client query CREATE TABLE IF NOT EXISTS users id SERIAL PRIMARY KEY name varchar description varchar tweets integer function onResult err result release reply send err result ADDING API ENDPOINTSLet s add other endpoints Endpoint to GET all the Users GET AL USERS fastify route method GET url users handler async function request reply fastify pg connect onConnect function onConnect err client release if err return reply send err client query SELECT from users function onResult err result release reply send err result rows Endpoint to get one User GET ONE USER if exists fastify route method GET url users id handler async function request reply fastify pg connect onConnect function onConnect err client release if err return reply send err client query SELECT from users where id request params id function onResult err result release reply send err result rows Endpoint to create one user UPDATE ONE USER fields fastify route method PUT url users id handler async function request reply fastify pg connect onConnect async function onConnect err client release if err return reply send err const oldUserReq await client query SELECT from users where id request params id const oldUser oldUserReq rows client query UPDATE users SET name description tweets request body name request body description oldUser description request body tweets oldUser tweets WHERE id request params id function onResult err result release reply send err Updated request params id Endpoint to Delete one user DELETE ONE USER if exists fastify route method DELETE url users id handler async function request reply fastify pg connect onConnect function onConnect err client release if err return reply send err client query DELETE FROM users WHERE id request params id function onResult err result release reply send err Deleted request params id The final routes js file should look like this async function routes fastify options Testing route fastify get async request reply gt return hello world INIT TABLE Launch just once to create the table fastify get initDB req reply gt fastify pg connect onConnect function onConnect err client release if err return reply send err client query CREATE TABLE IF NOT EXISTS users id SERIAL PRIMARY KEY name varchar description varchar tweets integer function onResult err result release reply send err result GET AL USERS fastify route method GET url users handler async function request reply fastify pg connect onConnect function onConnect err client release if err return reply send err client query SELECT from users function onResult err result release reply send err result rows GET ONE USER if exists fastify route method GET url users id handler async function request reply fastify pg connect onConnect function onConnect err client release if err return reply send err client query SELECT from users where id request params id function onResult err result release reply send err result rows Create users fastify route method POST url users handler function request reply fastify pg connect onConnect function onConnect err client release if err return reply send err const newUser request body client query INSERT into users name description tweets VALUES newUser name newUser description newUser tweets function onResult err result release reply send err result UPDATE ONE USER fields fastify route method PUT url users id handler async function request reply fastify pg connect onConnect async function onConnect err client release if err return reply send err const oldUserReq await client query SELECT from users where id request params id const oldUser oldUserReq rows client query UPDATE users SET name description tweets request body name request body description oldUser description request body tweets oldUser tweets WHERE id request params id function onResult err result release reply send err Updated request params id DELETE ONE USER if exists fastify route method DELETE url users id handler async function request reply fastify pg connect onConnect function onConnect err client release if err return reply send err client query DELETE FROM users WHERE id request params id function onResult err result release reply send err Deleted request params id module exports routes Now let s test these APIs POSTMANImportant you need to specify localhost and not in the first part of the url otherwise it doesn t work We will use Postman but you can use a whenever tool you wantFirst of all we need to create the user table We will trigger it by hitting with a GET this url GET http localhost initDBIf we get this answer it means that our users table has been created Now let s check all the users with another GET GET http localhost usersif we get the empty array answer it means that we actually have the users table in our DB but the are no users This is perfectly fine Let s create some users We will do this by making a POST request at the same endpoint adding the values in a json Example name Adrian description Kangaroo Fighter tweets Please notice that we don t need to add an id as it is automatically incremented at each new userLEt s add another oneand another one Now let s check again all the users And we see that this time we have users We can get one single users by adding the id of the user at the end of the previous url path For exampleGET http localhost users To get the user with the id To delete an user you can make a DELETE request at the same endpoint you use to get one user DELETE http localhost users Finally to Update the user you make a PUT request passing the new values inside a json like this name Adrian description SuperKANGAROO and you also need to pass the id of the user you wanna update in the url request like thisPUT http localhost users To check if the user has been really updated you can make another GET Request As you can see the name and the description of the user has changed but not the tweets ConclusionIf you have tried to follow this article I would like to know if you have encountered any problem Thanks GitHub Repository |
2022-01-10 18:25:41 |
Apple |
AppleInsider - Frontpage News |
Microsoft details macOS vulnerability that allowed protected data access |
https://appleinsider.com/articles/22/01/10/microsoft-details-macos-vulnerability-that-allowed-protected-data-access?utm_medium=rss
|
Microsoft details macOS vulnerability that allowed protected data accessMicrosoft has released details of the Powerdir vulnerability that allowed an attacker to access protected data on a Mac prior to the December macOS Monterey patches Published on Monday the blog by the Microsoft Defender Research Team explains the details behind the Powerdir vulnerability The discovery could allow attackers to bypass the operating system s Transparency Consent and Control TCC technology allowing access to protected user data TCC was introduced by Apple to macOS Mountain Lion in April and is designed to help users configure privacy settings for apps For example it would enable or deny access to onboard cameras and microphones a user s calendar or an iCloud account Read more |
2022-01-10 18:27:05 |
Apple |
AppleInsider - Frontpage News |
Steve Jobs introduced the first MacBook Pro 16 years ago |
https://appleinsider.com/articles/22/01/10/steve-jobs-introduced-the-first-macbook-pro-16-years-ago?utm_medium=rss
|
Steve Jobs introduced the first MacBook Pro years agoIn one moment on January Steve Jobs said Apple was through with the hit PowerBooks So instead he unveiled the first MacBook Pro with Intel inside The PowerBook had been a huge success for Apple from the day the first models were released on October But the entire range died years months and days later as Steve Jobs killed off the PowerBook and replaced it with the MacBook Pro It s now years years since he did that which means we ve had the MacBook Pro for longer than Apple s original portables And where the MacBook Pro was then introduced during the changeover from PowerPC to Intel processors today the MacBook Pro is a key part of the change from Intel to Apple Silicon Read more |
2022-01-10 18:24:52 |
Apple |
AppleInsider - Frontpage News |
Apple highlights how its services enrich the lives of its users |
https://appleinsider.com/articles/22/01/10/apple-highlights-how-its-services-enrich-the-lives-of-its-users?utm_medium=rss
|
Apple highlights how its services enrich the lives of its usersApple has highlighted its various services business including Apple Music and Apple TV in a new feature detailing how each of its platforms has grown Apple ServicesIn a new feature story published Monday Apple has reflected on how its services grew in ーand is looking ahead to more popular releases and features in New features include the launch of a classical music app for Apple Music the rollout of digital IDs in Wallet and the launch of D Apple Maps in Vancouver Montreal and Toronto later in the year Read more |
2022-01-10 18:11:35 |
ニュース |
BBC News - Home |
Russia downplays threat to Ukraine in Geneva talks |
https://www.bbc.co.uk/news/world-us-canada-59945170?at_medium=RSS&at_campaign=KARANGA
|
ukraine |
2022-01-10 18:46:28 |
ニュース |
BBC News - Home |
Cladding: Why is it unsafe and will flat owners be refunded? |
https://www.bbc.co.uk/news/explainers-56015129?at_medium=RSS&at_campaign=KARANGA
|
building |
2022-01-10 18:07:36 |
ニュース |
BBC News - Home |
Covid-19 in the UK: How many coronavirus cases are there in my area? |
https://www.bbc.co.uk/news/uk-51768274?at_medium=RSS&at_campaign=KARANGA
|
cases |
2022-01-10 18:04:12 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
日本が亡国の道を突き進む元凶、「やったふり」「先送り」キャリア形成の弊害 - 上久保誠人のクリティカル・アナリティクス |
https://diamond.jp/articles/-/292753
|
日本が亡国の道を突き進む元凶、「やったふり」「先送り」キャリア形成の弊害上久保誠人のクリティカル・アナリティクス昨年は、コロナ禍によって「デジタル化の遅れ」をはじめ、日本社会のこれまであまり明らかになってなかった問題が噴出した年だった。 |
2022-01-11 03:55:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
消費正常化は最大の景気対策 政府は3度目のワクチン接種、医療体制の拡充に注力を - 数字は語る |
https://diamond.jp/articles/-/292642
|
|
2022-01-11 03:45:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
日本生命「Nippon Life X」が引き金、22年は“生保イノベーション競争”が勃発 - ダイヤモンド保険ラボ |
https://diamond.jp/articles/-/292751
|
nipponlifex |
2022-01-11 03:40:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
FRBの量的引き締め、短期金融市場が肝に - WSJ PickUp |
https://diamond.jp/articles/-/291933
|
wsjpickup |
2022-01-11 03:35:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
ミーム株が年明け不発、昨年の高騰から一転 - WSJ PickUp |
https://diamond.jp/articles/-/291763
|
wsjpickup |
2022-01-11 03:30:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
中国「ゼロコロナ」政策に怒り拡大、死産の悲劇も - WSJ PickUp |
https://diamond.jp/articles/-/292603
|
wsjpickup |
2022-01-11 03:25:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
“長寿”が多い「サルディーニャ島中部」「沖縄北部」の人が毎日繰り返していること - 「脳活」に役立つ生活・健康習慣の知恵 |
https://diamond.jp/articles/-/292878
|
“長寿が多い「サルディーニャ島中部」「沖縄北部」の人が毎日繰り返していること「脳活」に役立つ生活・健康習慣の知恵ビジネスで成功している起業家たちは、生活や仕事でルーティンを実践していることが多い。 |
2022-01-11 03:20:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
ひろゆきが呆れる「時間の使い方が残念な人」ワースト1 - 1%の努力 |
https://diamond.jp/articles/-/289925
|
youtube |
2022-01-11 03:15:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
「SNSで人を見下してくる人にどう対処すべきか」への理にかなった回答 - 独学大全 |
https://diamond.jp/articles/-/292803
|
読書 |
2022-01-11 03:10:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
【初の執筆で珠玉の小説】 驚異の偏差値85を記録した 現役医師の国語力 - 精神科医Tomyが教える 心の荷物の手放し方 |
https://diamond.jp/articles/-/290155
|
【初の執筆で珠玉の小説】驚異の偏差値を記録した現役医師の国語力精神科医Tomyが教える心の荷物の手放し方感動小説『精神科医Tomyが教える心の荷物の手放し方』では、「期待」「不安」「選択」「好意」「悪意」「女王」「迷い」「決意」というつの物語を通じて、多くの人が抱えがちな不安や悩みの解決法を説く。 |
2022-01-11 03:05:00 |
コメント
コメントを投稿