投稿時間:2022-04-16 19:05:36 RSSフィード2022-04-16 19:00 分まとめ(10件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
js JavaScriptタグが付けられた新着投稿 - Qiita C#でMonacoEditor https://qiita.com/Yuki4/items/48c242c7795b43c2f34a electro 2022-04-16 18:21:06
AWS AWSタグが付けられた新着投稿 - Qiita VPCエンドポイントとAWS PrivateLinkの違い・関係性 https://qiita.com/miyuki_samitani/items/d2f599861bca764e66e7 awsprivatelink 2022-04-16 18:30:02
海外TECH DEV Community What Russia's invasion mean for developers https://dev.to/freebeliever/what-russias-invasion-mean-for-developers-1j39 What Russia x s invasion mean for developersI agree Russia s invasion isn t the most ideal event in the century However this event is especially causing damage at the tech industry Here s how The SplinternetThe splinternet is a theory of the internet being divided according to the splinternet theory each country would have it s own internet breaking the whole point of the internet With Russia s invasion Putin would likely cut Russia off the global internet because Putin want s to keep the invasion a secret After that Putin would likely create it s own internet that is monitored by his officers That really isn t something we want for Russia Customers of my personal customers are from Russia With Russia s invasion the number has lowered to less than percent I am not sure how it got to this but I am sure this isn t a coincidence is a lot for a company so this war isn t great for big companies that have customers from Russia ConclusionCustomers or even the internet is not important compared to the greater cost the war has brought us The deaths of thousands of people both Ukrainians and Russians 2022-04-16 09:48:58
海外TECH DEV Community How to create relational database in AWS https://dev.to/amitiwary999/how-to-create-relational-database-in-aws-2oni How to create relational database in AWSSQL is a programming language used to manage data in a relational database A relational database is a collection of data with defined relations between data I used AWS RDS for the relational database setup and saving data We can set up RDS in AWS free tier account If you want to learn how to do relational database setup in AWS RDS continue reading this blog Open AWS console and search for RDS Click on create the database Select standard creates so that we can configure the database according to our requirements MySQL is one of the most used relational database management systems Use MySQL as the engine RDS is available with the free tier account too so we will use the free tier as the template You will require a user name and password to connect to the database Next step we have to set up the database name user name and password in the settings Save the user name and password securely We can only use burstable classes in the free tier account I used the t micro because it is enough to try a relational database in the personal project and the cheapest StorageGeneral purpose SSD storage is best to handle the high load According to your requirement you can set the allocated storage GiB is enough for my project RDS support autoscaling If storage consumption reaches a threshold storage will increase automatically Autoscaling needs a maximum storage threshold It should be at least more than the currently allocated storage RDS will increase the storage up to this threshold value only Availability and durabilityMulti AZ deployment is recommended for production In an Amazon RDS Multi AZ deployment Amazon RDS automatically creates a primary database DB instance and synchronously replicates the data to an instance in a different AZ When it detects a failure Amazon RDS automatically fails over to a standby instance without manual intervention ConnectivitySelect VPC where you want to create a DB instance If you have not created the subnet group then you need to create one subnet group in the same VPC Click on subnet groups from the sidebar Give an appropriate name to subnet groups Select the VPC from the dropdown Each DB subnet group should have subnets in at least two availability zone If you don t have the subnet in at least two availability zone in the selected VPC then you have to first create two subnets in at least two availability zone in the selected VPC Select public access yes so that devices outside the VPC can connect to your database VPC security group require to allow access to your database You can edit inbound rules and allow access to your database Database AuthenticationI use password authentication If anyone needs to connect to the database then use the user name and password to connect to the database After the successful creation of the database you can see the endpoint and port in the connectivity and security section It requires connecting to the database For example if you want to connect to database from mysql workbench then ednpoint will become host name port will be same and user name and password will be the user name and password that you provided while creating database 2022-04-16 09:34:43
海外TECH DEV Community Let's build a simple system calls monitoring dashboard using bpftrace and streamlit https://dev.to/narasimha1997/lets-build-a-simple-system-calls-monitoring-dashboard-using-bpftrace-and-streamlit-2m1n Let x s build a simple system calls monitoring dashboard using bpftrace and streamlitIf you are from Computer Science background probably you might have heard of system calls also referred as syscalls to keep it short if you haven t then you can read this interesting beginner friendly article on system calls In general system calls are the glue between Operating System kernel and User applications System Calls are required for everything without system calls the user application cannot do anything because user applications need kernel support for memory management activities reading and writing from to disk display network interface audio devices etc In general the user application becomes virtually useless if it cannot make system calls Let us write and compile a simple C program that reads a file from the disk and outputs it once we compile the program we will use strace to see how many system calls our program makes to get the job done I will be using Ubuntu for all the experiments in this article So this is our C program it is simple and straightforward we are just opening the file called text txt assume that it is present using fopen reading the first line using fscanf and printing it to the terminal using printf include lt stdio h gt int main int argc char argv char buffer FILE fptr fopen text txt r if fptr NULL printf failed to open text txt fscanf fptr n buffer printf Read data s n buffer Let s compile this gcc read file c o read fileWe should be able to run the binary read file now let s trace what all system calls this program made We will use strace to count the number of system calls made by this program when executed Let s run strace C read fileThis should print a table showing some basic statistics of the system calls made during the program execution time seconds usecs call calls errors syscall execve mmap openat mprotect newfstatat pread munmap close brk read access write arch prctl lseek totalAs expected we have openat read and write system calls present in the table but why are there so many other system calls And also openat is called thrice but we are opening the file only once Well these are expected because C compiler is going to add some wrapper functions and bootstrap code some of the core libraries are also dynamically opened and loaded thus we have lot of other system calls which are unknown to us stracestrace as we saw in the above section provides lot of other capabilities as well for example we can also attach it to a PID and trace all the system calls made by that process We can use strace p lt PID gt We can also configure strace to suite many use cases by using one or more options provided by it just run strace h to list available options But we have a problem with strace i e the overhead of tracing To understand the problems of strace we need to look at ptrace the underlying system call used by strace About ptrace system call strace and most of the tracing tools like GDB make use of ptrace system call provided by Linux Kernel Any program can use ptrace system call with various options to get itself attached to another process and set breakpoints to examine the internal state of that process In our case strace starts as the parent process and calls ptrace initially passing PTRACE ATTACH and the PID of the child process that needs to be traced in our case it is read file built from read file c The child process also calls ptrace passing PTRACE TRACEME flag The kernel then makes some checks and privilege verifications before allowing strace to get attached to the child process if passed the kernel initializes some internal data structures required for tracing and notifications Next strace calls ptrace again but this time it passes PTRACE SYSCALL flag which makes the kernel to write TIF SYSCALL TRACE flag into the child processes s internal thread state which is like an indication that tracing is enabled for that process After this the child process is allowed to execute and strace waits for the child to make system calls If child makes any system call the TIF SYSCALL TRACE will be seen by the kernel s system call entry level function which will force the child process to trap halt by sending SIGTRAP signal Now that the child process is halted kernel collects and passes the architecture specific and architecture independent state data of the halted child process to the parent i e to our strace process strace can now parse this information and use it to display the tracing information After this child process is allowed to execute the system call once system call is complete another trap is generated by passing SIGTERM to the child and parent is notified about the completion of system call again by passing all the architecture specific and architecture independent state data then the child process is allowed to continue This cycle repeats for all the system calls made by the child process So the tracer i e the parent strace is notified twice per system call one at system call entry and another one at exit Now that we know about ptrace system call and the tool strace built on top of it we can look at the disadvantages of this approach ptrace cannot be used for system wide tracing this is because we need to attach tracing to all the available processes on the system which is not recommended In general ptrace is process specific This method involves lot of interactions between kernel and user space because ptrace passes the entire information to the tracer tool via a signal this information can be huge and it needs to be copied into a buffer in the user space Child process needs to be interrupted upon system call ptrace sets TIF SYSCALL TRACE in the thread state information of the child process which makes the kernel to pause the process s execution upon entry and exit of the system call this can be a bottleneck for a process that heavily depends on system calls Example Disk or Network intensive applications All these drawbacks doesn t mean ptrace is bad tools written using ptrace can be used for low level debugging and tracing but these tools are not suitable for continuous system wide tracing eBPF and bpftraceRecently starting from Linux kernel x the community introduced a new functionality called Extended Berkeley Packet Filters eBPF eBPF is a small sandboxed virtual machine that executes BPF byte code BPF is a simple filtering and data crunching language before eBPF BPF was used to filter and analyze network traffic by directly attaching it to data link layer read more about BPF here completely in the kernel space eBPF scripts can be attached to many event triggers within the kernel like interrupts system calls breakpoints function calls etc kernel maintains the mapping of these event triggers and attached eBPF scripts then it automatically executes these scripts whenever any of such events occur This is a very powerful kernel feature because it allows developers to extend the functionality of the kernel in a event driven way without writing and loading complex kernel modules It is also possible to dynamically attach remove these scripts and receive the outputs back in the user space Let s see how this can be helpful for monitoring and tracing Completely Event Driven We don t have to anymore stop the execution of the child process like we did when using ptrace these eBPF scripts are executed automatically when the event occurs Data Crunching in the kernel If our analysis involves lots of data we can filter and aggregate them in the kernel itself without transferring it to the user space this is because eBPF VM runs in kernel space Can monitor system wide events eBPF is not restricted to one process or thread it is system wide because it runs in the kernel This solves some of the issues we had with ptrace based implementations Recently iovisor project came up with a tool called bpftrace which can be used as an alternative to strace with more number of additional features bpftrace uses eBPF for core tracing and provides user space tools to harvest the tracing data To understand more about bpftrace read this reference guide bpftrace is not restricted just to system calls tracing we can also use it to trace Disk I O operations network operations CPU utilization etc Since bpftrace supports eBPF at it s core we can use BPF scripts to write our own tracing scripts easily If you are interested have a look at some of the cool tracing scripts built using BPF all these scripts can be readily used with bpftrace Let s experiment To try out bpftrace make sure you are using the latest kernel this is the kernel I am using right now uname r on my Ubuntu Linux machine genericYou can get the latest binary of bpftrace from their GitHub releases page Once downloaded check the version This is the version I am using just run bpftrace version bpftrace v Now let s run a simple BPF script with bpftrace that emits the count of system calls made by each process running on the system every seconds We need the output in JSON format so other applications can consume it we can tell bpftrace to emit JSON output by passing f json flag Note that bpftrace needs to be executed as sudo Here is the command we will execute sudo bin bpftrace f json e tracepoint raw syscalls sys enter comm count interval s print clear This script should make bpftrace emit the system call count of all the processes every seconds Here is the output type attached probes data probes type map data dockerd packagekitd epmd ibus engine sim gosecrets terminator thre ibus extension pipewire media GUsbEventThread rtkit daemon gvfs afc volume runsvdir Chrome ChildIOT Netlink Monitor uml switch docker gsd sharing thermald MemoryPoller containerd mc worker mc worker sh Cache I O apache dbus daemon ibus daemon mc worker avahi daemon systemd ThreadPoolForeg civetweb master memsup memcached JS Watchdog Socket Thread ThreadPoolServi NetworkManager systemd resolve DOM Worker gmain pulseaudio TaskConller poller TaskConller IPDL Background inet gethost threaded ml gnome terminal goport GeckoMain TaskConller scheduler mc worker dirty io sche LS Thread gdbus JS Helper IPC I O Parent IPC I O Child dnsmasq df bpftrace aux dirty cpu sch code dirty io sche Timer gnome shell TaskConller goxdcr scheduler scheduler NonIoPool NonIoPool godu Isolated Web Co prometheus cbq engine scheduler projector SchedulerPool alsa sink ALC dirty io sche indexer type map data wpa supplicant snap store epmd CacheThread Blo mc executor ibus engine sim ibus extension saslauthd port GUsbEventThread thermald Compositor pool usr libex GpuWatchdog gvfs afc volume runsvdir Chrome ChildIOT docker dockerd ibus daemon MemoryPoller uml switch jemalloc bg thd mc worker containerd apache mc worker MediaTrackGrph civetweb worker inet gethost JS Watchdog memcached mc worker irqbalance civetweb master gmain poller pulseaudio systemd resolve GeckoMain gnome terminal gdbus TaskConller threaded ml IPDL Background mc worker dirty io sche TaskConller aux sigar port bpftrace dirty cpu sch IPC I O Child IPC I O Parent TaskConller goport TaskConller scheduler gnome shell code Timer goxdcr dirty io sche scheduler dirty io sche scheduler NonIoPool NonIoPool prometheus dirty io sche cbq engine scheduler projector Isolated Web Co godu SchedulerPool alsa sink ALC indexer We ran bpftrace for seconds and thus we have two output logs in JSON format at first we receive attach event Let s build a simple dashboard in python to display the live dataNow that we are receiving the system call counts every seconds let s use it to build a live dashboard There are hundreds of tools and libraries available for building dashboards these days I decided to go with streamlit this python framework will allow us to spin up a dashboard with less code I wanted to keep it as simple as possible To get started with streamlit make sure you have python usually this will be installed by default on many Linux distributions We will install streamlit using pip pip install streamlit We will create a subprocess that runs bpftrace and collects the streamed content on stdout line by line we can use yield for this task We iterate over the outputs as and when they are emitted and update our streamlit table view Here is the python code which does that name it dashboard py import subprocessimport osimport shleximport jsonimport streamlit as stimport pandas as pdSCRIPT tracepoint raw syscalls sys enter comm count interval s print clear def exec cmd popen subprocess Popen cmd stdout subprocess PIPE universal newlines True for stdout line in iter popen stdout readline yield stdout line popen stdout close return code popen wait if return code raise subprocess CalledProcessError return code cmd def execute and listen for updates st title Real time syscalls counter table placeholder st empty total placeholder st empty try command shlex split bin bpftrace f json e format SCRIPT for entry in exec command entry json loads entry if entry type map data dict entry data proc names counts total for k v in data dict items proc names append k counts append v total v df pd DataFrame counts counts index proc names table placeholder table df total placeholder text total system calls str total except Exception as e print internal error e os exit if name main execute and listen for updates Thanks to streamlit because we could create a dashboard in less than lines of code Now let s run the streamlit app sudo streamlit run dashboard pyThis should spin up the webserver on port by defaultYou can now view your Streamlit app in your browser Local URL http localhost Network URL We can open the dashboard at http localhost or http lt your lan device ip gt to see the live system call table which updates every seconds Here is a screenshot of the dashboard from my computer lt img src alt drawing gt If you are interested to explore more you can explore many other streamlit charts The code I wrote above is not so optimal and many things can be improved I just wrote that to demonstrate how bpftrace can be integrated with other applications There is a tool called pixie which provides observability for kubernetes clusters using eBPF underneath if you are interested you can also have a look at it as well 2022-04-16 09:22:09
ニュース BBC News - Home Ukraine war: Russia bans Boris Johnson from country over Ukraine war https://www.bbc.co.uk/news/world-europe-61126391?at_medium=RSS&at_campaign=KARANGA ukraine 2022-04-16 09:50:30
ニュース BBC News - Home Patel personally approved Rwanda plan despite concerns https://www.bbc.co.uk/news/uk-61126360?at_medium=RSS&at_campaign=KARANGA rwanda 2022-04-16 09:05:32
サブカルネタ ラーブロ 夢を語れ 八王子@八王子市【2022新店】<ラーメン> http://ra-blog.net/modules/rssc/single_feed.php?fid=198196 八王子市 2022-04-16 10:13:49
サブカルネタ ラーブロ 熱烈中華食堂 日高屋 立川南口店@立川市【初訪店】<野菜たっぷりタンメン> http://ra-blog.net/modules/rssc/single_feed.php?fid=198197 熱烈中華食堂日高屋立川南口店立川市【初訪店】lt野菜たっぷりタンメンgt訪問日メニュー野菜たっぷりタンメン味塩コメント今日紹介するのは、立川駅南口から少しの所「一撃」の近くにある「日高屋」。 2022-04-16 10:06:35
北海道 北海道新聞 大型の鳥エミューが鳥インフル 国内初確認、北海道・網走の農場 https://www.hokkaido-np.co.jp/article/670395/ 鳥インフル 2022-04-16 18:07:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)