投稿時間:2023-04-15 22:04:45 RSSフィード2023-04-15 22:00 分まとめ(7件)
カテゴリー等 | サイト名等 | 記事タイトル・トレンドワード等 | リンクURL | 頻出ワード・要約等/検索ボリューム | 登録日 |
---|---|---|---|---|---|
Ruby | Rubyタグが付けられた新着投稿 - Qiita | ポリモーフィズムって何? | https://qiita.com/soichiro-saeki/items/64d773994c2cdec3cc18 | class | 2023-04-15 21:46:45 |
AWS | AWSタグが付けられた新着投稿 - Qiita | AWSアカウントを分割する理由 | https://qiita.com/k-krn/items/cf8f04f7fdb24f0919f9 | 運用 | 2023-04-15 21:24:34 |
技術ブログ | Developers.IO | Amazon API Gateway のカスタムアクセスログを使って API キーの使用量を独自に可視化してみた | https://dev.classmethod.jp/articles/api-gateway-key-resource-count/ | amazonapigateway | 2023-04-15 12:08:33 |
海外TECH | DEV Community | Setting up Git Bash / MINGW / MSYS2 on Windows | https://dev.to/pascallandau/setting-up-git-bash-mingw-msys2-on-windows-24cc | Setting up Git Bash MINGW MSYS on WindowsAn installation instruction for Git Bash MINGW MSYS on Windows with some notes on solving common problemsThis article appeared first on at Setting up Git Bash MINGW MSYS on WindowsIn this article I ll document my process for setting up Git Bash MINGW MSYS on Windows including some additional configuration e g installing make and apply some customizations via bashrc Table of contentsIntroductionHow to install and update Git Bash MINGW MSYS via Git for WindowsUpdate MINGWHow to install makeConfiguration via bashrcCommon issuesThe role of winpty Fixing The input device is not a TTY The path conversion issueFixing the path conversion issue for MINGW MSYSFixing the path conversion issue for winptyMiscellaneousChange the bash custom prompt to a IntroductionWhen I was learning git I started with the fantastic Git for Windows package that is maintained in the git for windows git Github repository and comes with Git Bash a shell that offers a Unix terminal like experience It uses MINGW and MSYS under the hood and does not only provide git but also a bunch of other common Linux utilities likebashsedawklscprm I believe the main shell is actually powered by MINGW as that s what will be shown by default Thus I will refer to the tool as MINGW shell or Git Bash throughout this article I have been using MINGW for almost years now and it is still my go to shell for Windows I could just never warm up to WSL because the file sharing performance between WSL and native Windows files was is horrible but that s a different story How to install and update Git Bash MINGW MSYS via Git for WindowsYou can find the latest Git for Windows installation package directly at the homepage of Older releases can be found on Github in the Releases section of the git for windows git repositoryFollow the instructions in the How to Install Git Bash on Windows article on git tower com to get a guided tour through the setup process After the installation is finished I usually create a desktop icon and assign the shortcut CTRL ALT B for bash so that I can open a new shell session conveniently via keyboard Update MINGWTo update Git for Windows you can simply rungit update git for windowsSee also the Git for Windows FAQ under How do I update Git for Windows upon new releases Git for Windows comes with a tool to check for updates and offer to install them Whether or not you enabled auto updates during installation you can manually run git update git for windows You can check the current version via git version git versiongit version windows Your browser does not support the video tag How to install makeAs per How to add more to Git Bash on Windows make Go to ezwinportsDownload file make without guile w bin zip get the version without guile Extract zipCopy the contents to your Git mingw directory merging the folders but do NOToverwrite replace any existing filesnavigate to the Git mingw directory via cd explorer Test via make version make versionGNU Make Built for WindowsCopyright C Free Software Foundation Inc License GPLv GNU GPL version or later lt This is free software you are free to change and redistribute it There is NO WARRANTY to the extent permitted by law Your browser does not support the video tag PS There s also an alternative way that I ve outlined in Install make on Windows MinGW though the one explained here is easier faster Configuration via bashrcThe MINGW shell is a bash shell and can thus be configured via a bashrc file located at the home directory of the user The shell supports the character as an alias for the home directory i e you can use bashrc to refer to the full path of the file This means you can also edit it easily via vi bashrc though I prefer an actual GUI editor like Notepad A common workflow for me to open the file is running the following commands in a MINGW shell session navigate to to the home directorycd open the file explorerexplorer My bashrc file usually includes the following setup Get bash completion for make targets by parsing make files in the current directory at the file Makefile all files with a mk suffix in the folders make and makefile see Notes h hides filenames s hides error messagescomplete W grep shoE a zA Z Makefile make mk makefile mk sed s a zA Z grep v PHONY make Docker login helper see easy container access via din bashrc helperfunction din filter user if n then user user fi shell bash if n then shell fi prefix if expr substr uname s MINGW then prefix winpty fi prefix docker exec it user docker ps filter name filter q head shell Links SO bash completion of makefile targetEasy container access via din bashrc helper Common issuesThe Git for Windows Known Issues page lists common problems with Git Bash and I want to provide some more context and solutions to the things that I have encountered The role of winpty Fixing The input device is not a TTY I encountered the The input device is not a TTY error while using docker To log into a running docker container or starting a container with a login session the i Keep STDIN open even if not attached and t Allocate a pseudo tty options must be given For interactive processes like a shell you must use i t together in order to allocate atty for the container process i t is often written it But attempting to do so viadocker run rm it busybox shyields the following error docker run rm it busybox shthe input device is not a TTY If you are using mintty try prefixing the command with winpty Fortunately the fix is included in the message Prefix the command with winpty Doing so works as expected winpty docker run rm it busybox sh winpty is according to it s readme a Windows software package providing an interface similar to a Unix pty master forcommunicating with Windows console programs The package consists of a library libwinpty anda tool for Cygwin and MSYS for running Windows console programs in a Cygwin MSYS pty So kind of a translator between your Windows input and the command input to create input that is compatible with a Unix pty pty pseudoterminal interface e g for docker According to the Git for Windows Known Issues page there are a number of other cases where winpty is required though I personally didn t encounter them yet Some console programs most notably non MSYS Python PHP Node and OpenSSL interactcorrectly with MinTTY only when called through winpty e g the Python console needs to bestarted as winpty python instead of just python CAUTION I ve seen people put an alias in their bashrc file to always prefix docker commands automatically with winpty like so alias docker winpty docker However winpty seems to break piping and can lead to unexpected results like the error stdout is not a tty See the following example docker run rm busybox echo foo catfoo winpty docker run rm busybox echo foo catstdout is not a ttyYou might work around this by adding the undocumented Xallow non tty flag like so winpty Xallow non tty docker run rm busybox echo foo catfooBut this doesn t seem to be a catch all solution and I would recommend against using it as a default or if you do only use it when the it flag is used as proposed in this answer The path conversion issueAh This one has given me lots of headaches over the years MINGW MSYS and winpty use automatic conversion of Unix paths to Windows paths e g foo gets translated to something like C Program Files Git foo where C Program Files Git is the installation directory of the Git for Windows installation Fixing the path conversion issue for MINGW MSYSFirst the behavior is mentioned on the Git for Windows Known Issues pageIf you specify command line options starting with a slash POSIX to Windows path conversion will kick in converting e g usr bin bash exe to C Program Files Git usr bin bash exe When that is not desired e g upload pack opt git bin git upload pack or L regex you need to set the environment variable MSYS NO PATHCONV temporarily like so MSYS NO PATHCONV git blame L pathconv msys path conv ccAlternatively you can double the first slash to avoid POSIX to Windows path conversion e g usr bin bash exe and also documented for MINGW at Posix path conversion but it s still brought up regularly see e g GH is replaced with the directory path of Git installation when using MinGW Bash or SO How to stop MinGW and MSYS from mangling path names given at the command lineExample docker run rm busybox ls fools C Program Files Git foo No such file or directoryAs quoted above it can be solved by eitheradding an additional to the path docker run rm busybox ls foo ls foo No such file or directoryprefixing the command with MSYS NO PATHCONV MSYS NO PATHCONV docker run rm busybox ls foo ls foo No such file or directoryor exporting the MSYS NO PATHCONV variable as an environment variable to disable the behavior completely export MSYS NO PATHCONV docker run rm busybox ls foo ls foo No such file or directoryCAUTION The value of the MSYS NO PATHCONV variable does not matter we can also set it to false or an empty string It only matters that the variable is defined MSYS NO PATHCONV docker run rm busybox ls fools foo No such file or directoryThis is particularly important when using the environment variable approach In order to selectively enable the path conversion again you must unset the MSYS NO PATHCONV first via env u MSYS NO PATHCONV e g env u MSYS NO PATHCONV docker run rm busybox ls fools C Program Files Git foo No such file or directory Your browser does not support the video tag CAUTION I ve seen people adding MSYS NO PATHCONV permanently to their environment in their bashrc file to always disable path conversion viaexport MSYS NO PATHCONV However this can have some unintended side effects When I tried it out my local installation of the gcloud cli stopped working with the error MSYS NO PATHCONV gcloud versionC Users Pascal AppData Local Programs Python Python python exe can t open file C c Users Pascal AppData Local Google Cloud SDK google cloud sdk lib gcloud py Errno No such file or directorySo instead I recommend setting MSYS NO PATHCONV either selectively per command or scope it to the use case I do this for example in my Makefiles by only exporting it for the scope of make and all scripts make invokes by putting the following code in the beginning of the Makefile OS is a defined variable for WIN systems so uname will not be executedOS shell uname Values of OS Windows gt Windows NT Mac gt Darwin Linux gt Linux ifeq OS Windows NT export MSYS NO PATHCONV endifThe path conversion is also documented for MSYS at Filesystem Paths Automatic Unix ⟶Windows Path Conversion and can be disabled via the MSYS ARG CONV EXCL environment variable For these cases you can exclude certain arguments via the MSYS ARG CONV EXCL environment variable MSYS ARG CONV EXCL can either be to mean exclude everything or a list of one ore more arguments prefixes separated by like MSYS ARG CONV EXCL dir bla test It matches the prefix against the whole argument string I e setting the variable as MSYS ARG CONV EXCL should disable the path conversion completely I myself have never had to use this though Using MSYS NO PATHCONV was always sufficient Fixing the path conversion issue for winptyUnfortunately winpty suffers from this path conversion issue as well In the standard installation of Git for Windows we can even see this by simply using echo winpty echo C Program Files GitThe behavior is known and flagged as a bug e g in GH issue Path conversion with and without winpty differs Remember the example I gave in section The role of winpty e g when using docker winpty docker run rm it busybox sh Now let s extend this and throw a volume into the mix winpty docker run rm v foo foo it busybox shdocker Error response from daemon create foo C foo C includes invalid characters for a local volume name only a zA Z a zA Z are allowed If you intended to pass a host directory use absolute path winpty converts foo to C Program Files Git foo so that the volume definition becomes v foo C Program Files Git foo which is of course invalid Using an additional as a prefix does work here as well winpty docker run rm v foo foo it busybox sh But there is no environment variable that we could use The only way to fix the path conversion is using a newer release of winpty and replace the one that is shipped together with Git for Windows as proposed by the maintainer of winpty This comment outlines the full process to replace winpty and is slightly adapted as follows create temporary directorymkdir tempcd temp download a newer releasecurl L output winpty tar gz extract the archivetar xvf winpty tar gz copy the content of the bin folder to usr bin which resolves to e g C Program Files Git usr bin replaces any existing files cp winpty msys x bin usr bin delete the temporary directorycd rm rf temp Your browser does not support the video tag Once the new version is installed the path conversion does not happen any longer even without specifying any environment variables Related comments issuecomment issuecomment CautionAfter updating MinGW the fix for winpty is gone Your browser does not support the video tag I e you need to re run the steps above every time you run an update MiscellaneousSome stuff that I need from time to time not necessarily only relevant for Git Bash Change the bash custom prompt to a Via PS Pascal LAPTOP DNLQ MINGW PS See How to Change Set up bash custom prompt PS in Linux | 2023-04-15 12:25:38 |
海外TECH | DEV Community | How Docker is helping developer and Dev Ops team?? | https://dev.to/vijendra/how-docker-is-helping-developer-and-dev-ops-team-m4n | How Docker is helping developer and Dev Ops team As we all are aware that many many tech companies adopted containerization bases applications because of their growing demand But what problems are solved by using docker For Developer What is the developer s main task in the job writing codes But Developer has to do all the setup work before writing codes and for different environments different sets up version issues etc What if I don t have to do set up and do only coding Here are some problems solved by docker Portability Docker containers are portable and can run consistently across different environments from development to production without changes or configuration This allows developers to easily move their applications between different systems reducing the risk of environment related issues Dependencies Docker allows developers to package an application and its dependencies into a single unit called a container This ensures that all the required dependencies libraries and configurations are included in the container which eliminates the works on my machine problem and makes it easy to share and deploy applications Consistency Docker provides a consistent runtime environment for applications regardless of the underlying infrastructure This reduces the risk of compatibility issues and ensures that applications behave predictably across different environments Scalability Docker makes it easy to scale applications horizontally by adding or removing containers as needed This allows developers to quickly respond to changes in demand and ensures that the application can handle increased traffic without downtime or performance issues Speed Docker can significantly reduce the time it takes to set up and configure development testing and production environments This enables developers to focus on writing code and delivering features rather than dealing with infrastructure related tasks And the problems that the Operation team faces are Environment inconsistencies Applications often behaved differently in different environments due to differences in the underlying infrastructure which made it difficult to replicate issues and deploy applications reliably Resource utilization Applications often required dedicated infrastructure which resulted in underutilized resources and higher infrastructure costs Complex deployments Deploying applications often required manual configuration and scripting which was time consuming and error prone Limited scalability Scaling applications vertically by adding more resources to a single server was often complex and expensive and scaling horizontally by adding more servers required complex load balancing and networking configurations Dependency management Managing dependencies between applications and different versions of libraries and software were often difficult and error prone leading to compatibility issues and application failTo address all these issues many companies started using a containerization based approach Terms that are always used with Docker are a Container b ImagesWhat is an Image in Docker An image is a template that defines the contents and configuration of a container An image is a read only file that includes everything needed to run an application such as code runtime system tools libraries and settings What is a container A container is a lightweight standalone executable package that includes everything needed to run an application such as code runtime system tools libraries and settings A container is an instance of a Docker image that runs as a process in isolation from the host system and other containers Then what is different between Container and Virtual Machine To Know the difference first have to know the general OS Structure Every OS Operating systems like Windows macOS or Linux has three layers The kernel layer serves as the operating system s core handling hardware allocation memory management and file systems for the application layer Docker solely virtualizes the application layer while Virtual Machines virtualize both the OS and Kernel layers That is the reason has compatibility problem but docker has given solution for this Docker Desktop In summary Docker containers offer a versatile and effective method for packaging and deploying applications ensuring consistent and isolated runtime environments that operate seamlessly across various systems and infrastructures How to Set Up Docker Create a Docker Image and Run It So Overall workflow looks like in docker Be sure to check out my upcoming blog post | 2023-04-15 12:05:35 |
Apple | AppleInsider - Frontpage News | Daily deals April 15: $600 off Sennheiser HD 800S, 15% off M2 134-inch MacBook Pro, $99 Apple TV 4K, more | https://appleinsider.com/articles/23/04/15/daily-deals-april-15-600-off-sennheiser-hd-800s-15-off-m2-134-inch-macbook-pro-99-apple-tv-4k-more?utm_medium=rss | Daily deals April off Sennheiser HD S off M inch MacBook Pro Apple TV K moreSaturday s top deals include up to off a inch MacBook Pro off AirPods Pro off a ninth gen iPad and more Save on Sennheiser HD S headphonesThe AppleInsider editorial team reviews the internet for top notch discounts at online stores to develop a list of unbeatable deals on popular tech items including discounts on Apple products TVs accessories and other gadgets We share the top bargains to help you save money Read more | 2023-04-15 12:17:53 |
海外ニュース | Japan Times latest articles | Police probe explosives attack as Kishida returns to election rallies | https://www.japantimes.co.jp/news/2023/04/15/national/politics-diplomacy/fumio-kishida-explosion-speech/ | Police probe explosives attack as Kishida returns to election ralliesA suspect is in custody after a cylindrical object landed meter from the prime minister who was evacuated before the device exploded | 2023-04-15 21:15:54 |
コメント
コメントを投稿