TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Using a ChatGPT as a compiler/transpiler for an inexistent programming language

2 pointsby nassimsoftwareover 2 years ago
I told chatGPT to transpile code from an imaginary programming language I invented and it was able to do so.<p>Here is the screenshot of the interaction : https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;hxNJxuM

1 comment

tapperover 2 years ago
I love what it can do and at the same time it&#x27;s scary. I asked it to write me a script to turn the wifi on my openwrt router at 9.30 pm and back on again at 6 am. It even commented the code.<p>Hi I want you to write me a script to ron on my OpenWrt router. I want to shut down my wifi at 9.30 PM and then turn it back on at 6 AM<p>Sure, here is a script that you can use to shut down your WiFi at 9:30 PM and turn it back on at 6 AM: Copy code #!&#x2F;bin&#x2F;sh<p># This script will shut down the WiFi at 9:30 PM and turn it back on at 6 AM<p># Check the current time CURRENT_TIME=$(date +%H:%M)<p># Shut down the WiFi at 9:30 PM if [ &quot;$CURRENT_TIME&quot; = &quot;21:30&quot; ]; then wifi down fi<p># Turn the WiFi back on at 6 AM if [ &quot;$CURRENT_TIME&quot; = &quot;06:00&quot; ]; then wifi up fi To use this script, you will need to save it to your OpenWrt router and make it executable. Here&#x27;s how you can do that: 1. SSH into your OpenWrt router using a command like `ssh root@192.168.1.1` (replace `192.168.1.1` with the IP address of your router) 2. Create a new file called `wifi-scheduler.sh` using the `nano` text editor: `nano wifi-scheduler.sh` 3. Paste the script into the file and save it: • Press `CTRL+X` to exit the text editor • Press `Y` to save the file • Press `Enter` to confirm the file name 4. Make the script executable: `chmod +x wifi-scheduler.sh` To run the script automatically at the specified times, you can add it to your router&#x27;s `crontab` (short for &quot;cron table&quot;). Here&#x27;s how you can do that: 1. Edit the `crontab` using the `crontab -e` command 2. Add the following lines to the `crontab` to run the script at 9:30 PM and 6 AM: Copy code 30 21 * * * &#x2F;root&#x2F;wifi-scheduler.sh 00 06 * * * &#x2F;root&#x2F;wifi-scheduler.sh 3. Save the `crontab` and exit the text editor That&#x27;s it! Your WiFi should now automatically shut down at 9:30 PM and turn back on at 6 AM.