github скрипты для tampermonkey
Github скрипты для tampermonkey
Tampermonkey is the most popular userscript manager, with over 10 million users. It’s available for Chrome, Microsoft Edge, Safari, Opera Next, and Firefox.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
This repository contains the source of the Tampermonkey extension up to version 2.9. All newer versions are distributed under a proprietary license.
Tampermonkey is the most popular userscript manager for Google Chrome.
Beneath of other tags, functions and features the following ones are supported:
For a full overview please take a look at the FAQ or just install TM. 😉
This code is provided entirely free of charge by the programmer in his spare time so donations would be greatly appreciated. Please consider a donation.
GPLv3. See COPYING for details.
Google Chrome or Chromium 17 or higher
BASIC BUILD INSTRUCTIONS:
Depending on your installed browser and OS (I hope this makes the overall scheme clear 😉
rel.crx is the Chrome extension, rel.pem the key to create another Tampermonkey extension file with the same extension ID
You can install rel.crx by drag’n’drop or (depending on your OS)
chrome.exe rel.crx chromium.exe rel.crx
coogle-chrome rel.crx chromium-browser rel.crx
This code is provided entirely free of charge by the programmer in his spare time so donations would be greatly appreciated. Please consider a donation.
About
Tampermonkey is the most popular userscript manager, with over 10 million users. It’s available for Chrome, Microsoft Edge, Safari, Opera Next, and Firefox.
Github скрипты для tampermonkey
This repository holds custom user scripts for Tampermonkey that we use at Spendesk.
Tampermonkey is a browser extension that allows you to inject custom JavaScript into webpages to customise/enhance their behaviour. For ex., we have some scripts that add extra warnings on GitHub’s website when merging Pull Requests.
Get the Tampermonkey extension for your browser:
Then click the extensions’s options page on the topbar of your browser:
Click on the ➕ button to add a new script
And paste the script you want to use, then hit + S to save it. You can do that multiple times to add different scripts.
Create a new custom user script directly in the Tampermonkey options, paste an existing one in the editor and start hacking. You can check if it works correctly by visiting a page where your script is supposed to run and reload that page every time you save a change.
Once you’re satisfied, simply copy your code and paste it in a new file in the scripts/ directory of this repository and add an example screenshot of what the script does in the screenshots/ folder (if applicable), then create a Pull Request on GitHub 🤓
How to make the script auto-update?
That’s pretty simple. Your script needs // @updateURL and // @downloadURL headers. The values will both be the url of the raw script, being https://raw.githubusercontent.com/Spendesk/tampermonkey-scripts/master/scripts/name-of-your-script.js
You need to be careful that you update the // @version each time you update your script, or it won’t be auto-updated.
The content of this repository is licensed under MIT.
Github скрипты для tampermonkey
Repository for Torn-related scripts, extensions, and more.
The majority of the third-party scripts are usually self-installing (just press an «install» button). They are usually hosted at either OpenUserJS or GreasyFork.
The rules for scripting, from the «Tools and Userscripts» forum (https://www.torn.com/forums.php#/p=threads&f=67&t=16037108&b=0&a=0), are as follows:
«The use of scripts, extensions, applications or any other kind of software is allowed only if it uses data from our API or a page you (or your users) have loaded manually and are currently viewing. They cannot make additional non-API requests to Torn, scrape pages that you’re not currently viewing, or attempt to bypass the captcha. If the software you’re using makes non-API requests that are not manually triggered by you, it is not allowed and can be tracked.
Assuming this rule is followed, go wild!»
This is somewhat vague, so I consulted with Bogie on some of the scripts I was unsure of. For instance, here is a snippet of our conversation regarding the ‘Torn Get Naked’ script:
Click to see conversation.
xedx: If I have a script that loads only when a user visits the page the script runs on, can the script use the Javascript click() function to click more than one button/link in succession? In particular, I ‘get naked’ often when wall sitting, so would like to un-equip with a single click. Is something like that legal, or illegal?
bogie: That wouldn’t be legal, sorry.
bogie: As it wouldn’t be performing server side actions for you, you’d be doing the main actions
xedx: OK, thank you very much! That’s a big help
bogie: But having one button do it all for you would be illegal
xedx: Got it. Thanks!
So that script has been modified to have 5 buttons, on one simple bar, to rapidly click through to equip/un-equip each category. The modified script has not yet been uploaded.
Note that the PNG files are not part of the installation, they are simple screenshots showing what to expect when the script is run. Any bugs, broken links, or suggestions, feel free to message me on Torn: xedx [2100735]. Every script of mine logs the start of script execution, and if required, will prompt for an API key which is saved in your private local storage so you are not prompted again. It is never shared in any manner.
Torn Weapon Experience Spreadsheet
This script displays your current Weapons Experience in a table or spreadsheet format, as well as finishing hits for each category. I used it to cut and paste the table as an image onto my profile page while merit hunting those two merits, ‘Specialized’ and ‘War Machine’. The table is in a dropdown DIV on the page. The first sample image shows it collapsed (not visible), the arrow on the DIV’s header expands it, that is visible in the second sample image.
Torn Weapon Experience Tracker
This script displays your current Weapons Experience on the Items pages, for Primary, Secondary, Melee and Temporary weapons, alongside each weapon, before the damage and accuracy stats.
Torn Personal Profile Stats
This script combines what was previously three separate scripts. On a person’s Profile page, it display the numeric equivalent of their rank, their net worth, and their estimated bat stats. This replaces the ‘Torn Bat Stat Estimator’, ‘Torn Numeric Rank Display’, and ‘Torn Net Woth Display’ scripts.
Torn Museum Set Helper
This script displays on your Iteems pages the number of full sets, if any, you have collected and if not, what items are missing.
This script allows you to drag and drop your enlisted race cars into any order you like. Saving this order will allow them to automatically appear in this order when starting a race. Or, you can reset to the Torn default.
Torn Hide-Show Chat Icons
Torn Latest Attacks Extender
This script adds an extended ‘latest attacks’ screen to your home page. It is configurable and allows you to display up to 100 of the latest attacks, and adds attacking (or attacked) faction name and respect earned. Your API Key is required, as this uses the Torn API so is completely legal. You key is never shared. Before first use, the configuration dialog should appear asking for your key.
As of 03/03/2020, you can now click the attack to get the full attack log (version 0.2). This is thanks to Chedburn adding the log ID to both the ‘attacks’ queries under user and faction.
Torn Gym Gains
Torn Fac Respect Earned
This script add a section to the Faction Stats area on your home page, listing the respect you have earned for your faction so far. It has a tool tip, so if you hover over the respect you have earned, it will tell you what medals and honors (merits) are available, and how close you are to getting them.
Torn Bounty List Extender
This script adds rank next to the level in the Bounties List. The goal was to make it easier to more quickly decide what targets for an attack, without having to inspect each user individually. The queried ranks are locally cached so as not to exceed the Torn API call limit.
Torn Bat Stat Estimator
This script uses the method described here: https://www.torn.com/forums.php#/p=threads&f=61&t=16065473&b=0&a=0 to estimate a user’s bat stats, as best as can be estimated with publicly available stats. The possible range of bat stats is displayed on the user’s profile page. This is most useful for lower level players, due to the ranges involved at higher levels. Also, ‘ghost’ triggers can’t be helped, for instance if you hit a NW trigger and then lose it. Also, level holding will also throw off the results, usually resulting in an ‘N/A’ result. Always check things like Xanax and refills used, and other indicators also before relying on this estimate to pick a fight!
Torn Get Naked
Removed, replaced by Loadouts
Note: Removed for now, see the comments in the Scripting Rules section, above.
New note: ‘Loadouts’ replace the functionality of this script, so now definitely retired.
Sneak Peak at v2, that follows the rules:
Per Bogie’s reply to my questions regarding this script, it has since been modified so that there are now 5 buttons, not one, hence the following paragraph is slightly outdated.
Note: The ability to restore weapons modes may wind up being a separate script, so you’d still have to go to the mods page, but there would be a new dialog at the top with Save and Restore buttons. So one click would save the current config, and one click to restore that config. The current script does display what mods you have in place currently on un-equip, but does not yet restore them.
Torn Net Worth Display
This simple script display a user’s net worth on their profile page, immediately beneath their «last action». Note that this is net worth, not cash on hand. Updated at new day.
Torn Numeric Rank Display
This simple script appends a user’s rank number next to the rank in the User Information section of a user’s profile. I find it easier than scrolling down to look at the rank that is also displayed in the Medals section (which is off by one from the actual titled rank).
Torn One-Click Daily Dime
Note: I’ve removed this for now, as I’m not sure if it breaks the rules or not (see the ‘Scripting Rules’ section, above). I’ll have to confer with Bogie again to verify.
Torn User List Extender
This script adds rank next to the level in the User List, as seen when searching for users. The goal was to make it easier to more quickly decide what targets for an attack, without having to inspect the user individually. It helps to quickly determine who may be level holding. Of course, you may want to still look at things such as Xanax or SE’s used, that is up to you.
Torn Crime Tooltips
Adds Tool Tips to the Criminal Offences display on your home page. Useful for merit hunting.
Torn Drug Stats
This script adds a new section to your Home page, and display beneath the faction perks section a new section, similar to the Crimes section, displaying your drug usage (individual and total), ODs, Rehabs and money spent on rehab in total. Can be used towards monitoring your progress towards the drug merits, comes with tool tips to display merit progress.
Torn Jail Stats
Torn Jail Scores
This script adds the «score» of a user in jail, which is used to determine the difficulty (or your chance of success) of busting that user out of jail. The score is displayed as a number in parenthesis beneath the user’s level. The score corresponds directly to the DocTorn ‘Quick Bust/Quick Bail/Min Score/Max Score’ bar scores. Some information, mostly speculative, can be found in this guide: https://www.tornstats.com/guides.php?id=22 Will also give you an idea of what to use as scores on the DocTorn bar if you’d like to use those filters.
Torn War Wall List Extender
Similar to the User List Extender, this extends the user list on the territory wall page(s) when your faction is in a war. It appends the numeric rank next to the level of all people on the wall. Note that internal caching is done to prevent too many API calls, if a user’s ID has already been mapped to a rank, a new request to the Torn API is not generated.
Torn War Other Fac Extender
These scripts aren’t mine, just here for easy access by fac mates. The links link to the respective author’s repos, either GitHub, OpenUserJS, or GreasyFork.
Torn: Racing enhancements by Lugburz (Highly recommended!)
Show car’s current speed, precise skill, official race penalty, racing skill of others and race car skins. Among other things.
Easter Egg Hunt: Random
To aid in just clicking around Torn, to hopefully stumble across more Easter Eggs, ths script puts an icon/link on your page that takes you to a random page in Torn. I had a small hand in it, it works very well. Not supposed to guarantee any more eggs, but easier to go around to new places you may never have been. I’d recommend using it in conjunction with DoctorN’s «Alert me if there’s an Easter Egg on the page» option enabled.
TORN HighLow Helper
The two following links point to the same code, no idea why named differently.
OpenUserJS link: (now an empty shell)
Alternate, GreasyFork link:
Helper to assist in getting the Hi/Lo merit. Simply picks the best choice via odds, worked for me, but not infallable. Took me about 20 minutes and maybe 100 or 120 tokens. Makes it a lot easier, though. Just click click click your way through it. Written by DeKleineKobini [2114440]
Stock Helpers, obsoleted by Stocks 3.0. Click to see details.
Stock Block Price
Displays the cost of a BB of stock on the Stock Exchange page, beneath the share price. Useful to quickly see the price of a BB without having to ‘fake’ buying it or use a calculator. Written by nepherius [2009878]
Note 2: I think this has subsequently been added to Torn itself, on the ‘About’ tab in the stock market or portfolio pages.
Stock Market Helper
Note: the link is disabled as I do not have permission from Mafia to re-distribute. He has taken down ALL of his scripts. Kept here for legacy purposes.
Bazaar Scam Warning
Puts a big red warning on items that are priced way above their market value. Written by Sulsay [2173590]
Race Helper
Racing assistant script. Note: the link is disabled as I do not have permission from Mafia to re-distribute. He has taken down ALL of his scripts. Kept here for legacy purposes.
Click to see description.
Accurate Stats for your car Showing accurate stats number of your car with percentage on your Listed Cars and Race Events
EASY UPGRADE NOTIFICATION Got random events when your car crashed during race?
Don’t worry, with this feature, you will notice which categories are available to upgrade (if you are not fully upgrade your car)
Also, there are feature to download all saved upgrade stats of your car into 1 CSV / Excel format. You can use it later if you need to view it at all or sorting on your pc.
Originally written by Mafia [610357], this is a slightly modified version as his was pulled. This one won’t auto-update to the removed version. Kept for legacy purposes.
Once in the Chrome App Store, the link will point there instead, and should install from there.
Deprecated, no longer updated/supported. Click to see details.
Torn Loot Level Notifier
Note: Most, myself included, find it just as easy to monitor YATA’s NPC loot page: https://yata.alwaysdata.net/loot/
This script displays notifications regarding NPC loot levels, health, and the time when the next loot level will be hit, as well as an option to go directly to the NPC’s attack page. The notifications displayed can be configured from the Options menu. The options allow you to select which NPC’s to be notified about. At present this is only Duke and Leslie. You may also select to display notifications when the player is in hospital, at Loot Level I, II, III, IV or IV, and any combination of the above. By default, the notification is displayed for 10 seconds but can be closed at any time, and there is an Attack button available to go directly to the player’s Attack page.
This has been tested on PC’s and Mac’s, but since I’m using a Mac, mostly on a Mac.
This extension requires you to enter your API key in the Options dialog. If not entered, the Options dialog will open automatically when run.
There is a warning Idisplays as an error) about an synchronous call, this can be ignored. I will address this later, given time. Async is partially implemented but still in alpha, so not enabled at this time.
I have re-written this to use the YATA API, but the most recent version (1.6.3) has not been uploaded yet.
Third Party Extensions
These extensions aren’t mine, just here for easy access by fac mates. The links link to the respective author’s repos or the Chrome App Store.
Torn HiLo Assistant
Google Sheets and Scripts
The following are Google Sheets and App Scripts that integrate with the sheets and the Torn API. If your API key is required, you will be prompted and it will be saved on a hidden sheet, called ‘Options’, that is created dynamically if need be. The links point to a sheet on my account, read-only, so you must make a copy and rename it to whatever you like in order to uses it. Then you can erase the read-only link to mine.
Inventory by XedX
This allows you to view your inventory regardless of whether you are in Torn or not. It is a simple Google Apps Script and sheet(s) (created automatically) that uses one API call to retrieve your inventory and display it in worksheets titled by item type, just as on the Torn inventory page.
Images: Coming soon!
Bazaar Inventory, by XedX
This allows you to view your Bazaar regardless of whether you are in Torn or not. It is a simple Google Apps Script and sheet(s) (created automatically) that uses one API call to retrieve your inventory and display it in worksheets titled by item type, just as on the Torn inventory page. Note that if you Bazar is closed (or has nothing in it), nothing is displayed. Three is no way I know of to differentiate between the two situations. If anyone does, please let me know.
Images: Coming soon!
Torn Stock Ticker
This requires some configuation. After downloading from the above link, make a copy, renaming if you like, from Google Sheet’s File->Copy menu. This will give your own, private, editable copy. Next, enter on the Options sheet your API key and optionally, an e-mail address and/or Discord webhook channel URL to receive event notifications. Finally, from the Tools->Script Editor option in Google Sheets, select the icon that looks a bit like a stopwatch to add a trigger. See the ‘Trigger Options’ images, below, for more details.
Github скрипты для tampermonkey
Failed to load latest commit information.
README.md
Script 1. KVM Backup im laufenden Betrieb. Entnommen aus dem Artikel
Es wird zuerst ein Snapshot aller Volumes einer VM angelegt. Dadurch besteht jedes Volume aus (mindestens) zwei Dateien: eine Datei mit den originalen Daten und eine zweite Datei, welche alle Änderungen gegenüber dem Originalvolume ab dem Erstellen des Snapshots enthält.
Anschließend werden mit einem sogenannten Blockcommit die im Snapshot als Änderungen geschriebene Blöcke in das Originalvolume wieder eingearbeitet.
snapshot-create-as erzeugt in einem Schritt ein Snapshot aller Volumes der VM.
Für alle laufenden VMs wird ausgeführt:
Nach dem Abarbeiten aller Volumes wird das XML-Definitionsfile der jeweiligen VM ebenfalls ins Backup-Verzeichnis kopiert.
Für die Option «—quiesce» in virsh snapshot-create-as ist es notwenig, dass auf dem Gast der sogenannte «qemu-guest-agent» installiert ist. Dieser kann Befehle vom Host-System entgegen nehmen und wie in diesem Fall, das Dateisystem in einen konsistenten Zustand versetzen.
Für jede VM werden die Volumes aufgelistet, ein Snapshot aller Volumes angelegt und anschließend jedes Volume gesichert. Danach werden die Snapshots wieder in die Original-Volumes eingearbeitet
Список дисков виртуальной машины.
Информация о конрктеном диске заданной виртуальной машины
Список снепшотов заданной виртуальной машины и инфомарция о текущем её снепшоте.
Посмотреть подключённые диски с выводом информации о размере и свободном пространстве можно с помощью утилиты
Можете узнать ещё больше с помощью команды lsblk:
Userscripts. Углубляемся
Как упоминалось в предыдущей статье, юзерскрипты поддерживаются всеми современными браузерами. И даже кое-как поддерживаются в IE7 и выше.
Пару слов о движках
Качество поддержки юзерскриптов находится на разном уровне в разных браузерах. Лучше всего поддержка юзерскриптов выполнена в браузерах Firefox и Chrome.
Эти браузеры предоставляют более менее дружелюбные интерфейсы для управления юзерскриптами.
Самые жесткие ограничения на юзерскрипты накладывает Chrome. Но почти все эти ограничения обходятся упаковыванием скрипта в простое расширение. Подробности этого процесса мы обсудим в следующей статье.
Теперь поговорим подробнее о поддержке юзерскриптов в отдельных браузерах.
Поддержка в Firefox
Mozilla Firefox поддерживает юзерскрипты после установки расширения GreaseMonkey (в русском сленге — обезъяна) или Scriptish.
После установки расширений фаерфокс получает поистине мощную поддержку юзерскриптов.
Рассматриваемая далее информация применима в первую очередь к GreaseMonkey (это расширение было первым).
Исторически, все юзерскрипты писались под браузер Firefox именно из-за наличия удобного плагина.
Это обусловливает тот факт, что все браузеры, которые поддерживают юзерскрипты, дополнительно следуют основным правилам спецификации GreaseMonkey по разбору метаданных.
Это означает, что все скрипты, которые были написаны под GreaseMonkey, будут устанавливаться и запускаться в браузерах, поддерживающих юзерскрипты (с минимумом модификаций).
К сожалению, ни один браузер, кроме Firefox, не предоставляет GM API. Этот печальный факт заставляет использовать эмуляции GM API через расширения или дополнительные юзерскрипты.
В случае разработки юзерскрипта «с нуля», я считаю предпочтительным отказаться от эмуляции GM API и использовать «велосипеды» собственного производства. Это позволяет уменьшить число зависимостей юзерскрипта, что, в свою очередь, позволяет вести разработку в рамках концепции одного файла: модифицировать придётся всего один файл; пользователю нужен всего один файл для запуска юзерскрипта.
Концепция одного файла позволяет существенно уменьшить сложность поддержки и кроссбраузерной разработки юзерскриптов!
Поддержка в Chrome
Google Chrome поддерживает юзерскрипты нативно, т.е. не требует установки плагинов/расширений. Можно (иногда нужно) упаковать юзерскрипт в расширение.
Важно: фактически, расширение и юзерскрипт — разные понятия. И если подходить к вопросу строго, стоит говорить о разработке простых расширений под Chrome.
В случае, когда юзерскрипт требует нестандартного, «тяжелого» функционала, он требует упаковки в расширение.
Для упаковывания юзерскрипта в расширение нужно проделать дополнительные действия один раз. Вся последующая разработка будет вестись в рамках концепции одного файла.
Поддержка в Opera
Opera поддерживает юзерскрипты нативно, но не предоставляет сколь-нибудь дружелюбного пользовательского интерфейса для управления скриптами. Такой интерфейс доступен в расширении UJS Manager.
Поддержка в IE
IE7, IE8, IE9 поддерживают юзерскрипты при использовании плагина Trixie.
К тому же, имеется более продвинутый плагин IE7Pro. В IE7Pro помимо поддержки юзерскриптов имеется множество других бесполезных возможностей.
Важно: Если не отключать дополнительные «приблуды» в IE7Pro, то плагин может изрядно тормозить браузер, особенно на тяжёлых страницах.
Как видите, с запуском скриптов у IE дела обстоят паршиво. Остаётся радоваться, что такая возможность вообще имеется.
Важно: Оба плагина могут существовать в системе одновременно, не мешая друг другу.
Важно: Учитывая вышесказанное, я всегда предлагаю своим пользователям использовать Trixie.
Поддержка в Safari
К сожалению, мне не довелось поработать с данным браузером. Буду рад любым разъяснениям в комментариях!
Поговаривают, что для Safari нужны SIMBL и плагин GreaseKit.
Поддержка в Mobile Safari и прочих браузерах
В виду отсутствия поддержки юзерскриптов в менее популярных браузерах и мобильных браузерах, юзерскрипты придётся предоставлять в виде букмарклета.
Соотстветственно, метаданные в таком случае не нужны, а букмарклет придётся запускать руками после каждого рефреша.