I asked Bing to create a JSON data for O’day sailboats This is a great use case to generate fixed data in way you want it for your app. Save lots of times searching and typing. create a json file for Oday’s sailboats, data to include – length overall, sailarea, make and model Bing did a search and fed […]
Using Bing Chat to generate json file for fixed data.
ChatGPT – creating a C++ file search with csv output
I first started with Python and that worked well. I then did a perl version. That went well. So, I thought – why not go for the jugular – write a c++ one. I call it file_audit – save a csv formatted file so I can review and sort by date to see what I need to save or delete. […]
FreeBSD – increasing size of root disk with KVM/QEMU
Here is how to to increase the size of the disk for FreeBSD. I am using FreeBSD 12.3 here running inside a Fedora Linux. Here are some starting requirements One needs to have qcow2 type disk. the virtual machine must be shutdown No snapshots against the virtual machine So, I cloned out the machine to test: [jon2allen@fedora Downloads]$ ll freebsd*.qcow2 […]
Find command – listing last modify path with full dir
Some examples of this command from Linux Debian and FreeBSD Here is how to do this with GNU Linux – %p gives full path name user1@f1-google-joniowa:~$ find . -name “weather_obs.log” -printf “%p\t%TY-%Tm-%Td\n” ./test27/weather_obs/weather_obs.log 2023-05-16 ./test26/weather_obs/weather_obs.log 2022-12-08 ./test28/weather_obs/weather_obs.log 2023-02-28 ./test25/weather_obs/weather_obs.log 2022-08-18 ./python/weather_obs/weather_obs.log 2021-05-24 ./test24/weather_obs/weather_obs.log 2022-11-22 Here is a bsd version – uses exec [user1@freebsd12_3 ~]$ find . -name […]
finding files and using tar for backup.
The most common solution is to use find with xargs to backup Something like this: find /var/www/html/ -type f -name my*.csv -print0 | xargs -0 tar cfvzP /backupdir/backupfile The more files you have, especially over 1000 – this will produce weird results. Number of files in the archive doesn’t match the output of the find xargs will split the input […]
Pandas – convert from dataframe append to concat.
the latest Pandas gives warning about append being depreciated. FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead. The main difference is that concat expects an iterable list. monnth_df = pd.concat( [ month_df,obs1 ], ignore_index=True) # month_df = month_df.append(obs1, ignore_index=True)
FreeBSD – setting up serial logins with Linux/KVM
FreeBSD – virsh serial howto Goal is to setup FreeBSD so you can connect to virtual serial port for login Add serials to KVM instance. Use Virtual Manager one is usually the default – you can add up to 3 more. In the virtual FreeBSD machine, edit the /etc/ttys Change the 3wire/ ttyu0 to std.9600. Secure means root can login […]
Use sed command to change column names in csv files
Problem: – You have several CSV file that have a title that needs to change. In my example I had a column name that was need to change from “Time(edt)” to just “Time” To run a test: note: no special backslash needed for “(” or “)” You can glob the files and it will do all of them. sed ‘s/Time(edt)/Time/g’ […]
ping: socket: Operation not permitted
Got error with Debian Bullseye jon2allen@lamp2c$ ping www.yahoo.com ping: socket: Operation not permitted to allow all users to ping again echo “0 2147483647” > /proc/sys/net/ipv4/ping_group_range to make permanent echo “net.ipv4.ping_group_range = 0 2147483647” >> /etc/sysctl.conf Here is where it is documented https://lore.kernel.org/lkml/20110518174959.GA6019@albatros/ https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt
Bitnami VM – how to enable SSH for password ( notes )
There is a special procedure. ( debian ) SSH is disabled by default. If you download a VM from bitnami sudo rm -f /etc/ssh/sshd_not_to_be_run sudo systemctl enable ssh sudo systemctl start ssh So, to enable password. edit /etc/ssh/sshd_config Uncomment the password field # To disable tunneled clear text passwords, change to no here! PasswordAuthentication yes #PermitEmptyPasswords no To add a […]